...
 
Commits (30)
# A set of files you probably don't want in your WordPress.org distribution
/.distignore export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitlab-ci.yml export-ignore
/.travis.yml export-ignore
/.DS_Store export-ignore
/Thumbs.db export-ignore
/behat.yml export-ignore
/bitbucket-pipelines.yml export-ignore
/bin export-ignore
/.circleci/config.yml export-ignore
/composer.json export-ignore
/composer.lock export-ignore
/Gruntfile.js export-ignore
/package.json export-ignore
/package-lock.json export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/multisite.xml export-ignore
/multisite.xml.dist export-ignore
/.phpcs.xml export-ignore
/phpcs.xml export-ignore
/.phpcs.xml.dist export-ignore
/phpcs.xml.dist export-ignore
/README.md export-ignore
/wp-cli.local.yml export-ignore
/yarn.lock export-ignore
/tests export-ignore
/vendor export-ignore
/node_modules export-ignore
/*.sql export-ignore
/*.tar.gz export-ignore
/*.zip export-ignore
......@@ -26,6 +26,7 @@ before_script:
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/automattic/vipwpcs,$HOME/.composer/vendor/phpcompatibility/php-compatibility,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-wp
PHPunit:PHP7.2:MySQL:
stage: test
image: containers.ethitter.com:443/docker/images/php:7.2
services:
- mysql:5.6
......@@ -35,6 +36,7 @@ PHPunit:PHP7.2:MySQL:
- phpunit
PHPunit:PHP7.3:MySQL:
stage: test
image: containers.ethitter.com:443/docker/images/php:7.3
services:
- mysql:5.6
......@@ -42,3 +44,12 @@ PHPunit:PHP7.3:MySQL:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpcs -n
- phpunit
PluginSVN:
stage: deploy
image: containers.ethitter.com:443/docker/images/php:7.3
before_script:
- curl -o ./bin/deploy.sh https://git-cdn.e15r.co/open-source/wp-org-plugin-deploy/raw/master/scripts/deploy.sh
- chmod +x ./bin/deploy.sh
script: ./bin/deploy.sh
when: on_success
......@@ -3,8 +3,8 @@
**Donate link:** http://www.thinkoomph.com/plugins-modules/view-all-posts-pages/
**Tags:** view all, pages, paged, paged post, multipage, single view, single page, wp_link_pages, nextpage, next page, quicktag
**Requires at least:** 3.2.1
**Tested up to:** 5.0
**Stable tag:** 0.9.1
**Tested up to:** 5.2
**Stable tag:** 0.9.3
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
......@@ -45,7 +45,11 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
## Changelog ##
### 0.9.3 ###
* Compatible with WordPress 5.2
### 0.9.2 ###
* Compatible with PHP 7.3
* Introduce PHPCS tests
* Update plugin based on PHPCS results
......@@ -61,7 +65,7 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
### 0.8 ###
* When WordPress determines a request is a 404, don't activate the plugin's functionality.
* Convert the plugin to a singleton.
* Audit entire plugin for translation readyness.
* Audit entire plugin for translation readiness.
* Correct phpdoc.
### 0.7 ###
......@@ -99,6 +103,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
## Upgrade Notice ##
### 0.9.3 ###
Ensures compatibility with WordPress 5.2.
### 0.9.2 ###
Adds support for PHP 7.3 and fixes various PHPCS errors, neither of which should impact the plugin's functionality.
......
......@@ -2,10 +2,10 @@
# This file is distributed under the same license as the View All Posts Pages package.
msgid ""
msgstr ""
"Project-Id-Version: View All Posts Pages 0.9.2\n"
"Project-Id-Version: View All Posts Pages 0.9.3\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/view-all-posts-pages\n"
"POT-Creation-Date: 2019-02-05 18:43:53+00:00\n"
"POT-Creation-Date: 2019-05-12 18:33:30+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
......
......@@ -3,8 +3,8 @@ Contributors: ethitter, thinkoomph
Donate link: http://www.thinkoomph.com/plugins-modules/view-all-posts-pages/
Tags: view all, pages, paged, paged post, multipage, single view, single page, wp_link_pages, nextpage, next page, quicktag
Requires at least: 3.2.1
Tested up to: 5.0
Stable tag: 0.9.1
Tested up to: 5.2
Stable tag: 0.9.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -45,7 +45,11 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
== Changelog ==
= 0.9.3 =
* Compatible with WordPress 5.2
= 0.9.2 =
* Compatible with PHP 7.3
* Introduce PHPCS tests
* Update plugin based on PHPCS results
......@@ -61,7 +65,7 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
= 0.8 =
* When WordPress determines a request is a 404, don't activate the plugin's functionality.
* Convert the plugin to a singleton.
* Audit entire plugin for translation readyness.
* Audit entire plugin for translation readiness.
* Correct phpdoc.
= 0.7 =
......@@ -99,6 +103,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
== Upgrade Notice ==
= 0.9.3 =
Ensures compatibility with WordPress 5.2.
= 0.9.2 =
Adds support for PHP 7.3 and fixes various PHPCS errors, neither of which should impact the plugin's functionality.
......
......@@ -23,7 +23,7 @@ require_once $_tests_dir . '/includes/functions.php';
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
require dirname( dirname( __FILE__ ) ) . '/view-all-posts-pages.php';
require dirname( __FILE__, 2 ) . '/view-all-posts-pages.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
......
<?php
/**
* Class PostFilters
*
* @package View_All_Posts_Pages
*/
/**
* Content-filter test case.
*/
class PostFilters extends WP_UnitTestCase {
/**
* Text for each page of multipage post.
*
* @var array
*/
protected static $pages_content = [
1 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec at neque sit amet massa pulvinar ullamcorper. Sed cursus, quam a tristique volutpat, diam justo cursus nunc, eu elementum sem orci ut ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras aliquet, diam sit amet tincidunt pulvinar, tortor neque accumsan dui, efficitur placerat justo nisl et justo. Pellentesque convallis dui nulla, vel finibus dui cursus quis. Sed semper nunc et euismod tristique. Aliquam tincidunt eget massa ac congue. Ut ipsum eros, dignissim ut eleifend eu, consectetur a eros. Proin in mattis dui.',
2 => 'Sed sed sapien et lectus aliquam tempor. Duis consequat sapien scelerisque metus pulvinar aliquam. Pellentesque vestibulum id justo vel egestas. Nullam a metus sed risus blandit egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed scelerisque ipsum ante, quis iaculis nibh suscipit eget. Nulla facilisi. Nulla at lacus at mauris sodales varius et nec massa. Etiam in nisi commodo, semper velit vitae, condimentum nisl. Ut quis mauris non ipsum feugiat vehicula pulvinar vitae dui. Nulla facilisi.',
3 => 'Donec condimentum ipsum felis. Vivamus rhoncus mauris ac commodo hendrerit. Quisque ultrices nibh laoreet purus volutpat, ut congue purus suscipit. Sed eget lacus nec eros scelerisque volutpat. Fusce tristique quam eu risus porta, id vulputate dui maximus. Phasellus suscipit faucibus leo, imperdiet facilisis nisi. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet velit eu felis rhoncus placerat vel rutrum ante. Donec luctus urna quis nulla porta vestibulum. Vivamus ac lacinia odio.',
];
/**
* Page break trigger.
*
* @var string
*/
protected static $page_break = "<!--nextpage-->";
/**
* Test post ID.
*
* @var int
*/
protected static $post_id;
/**
* Prepare data for tests.
*/
public function setUp(): void {
parent::setUp();
static::$post_id = $this->factory->post->create(
[
'post_title' => 'Pagination Test',
'post_status' => 'publish',
'post_date' => '2019-01-01 00:01:01',
'post_content' => implode( static::$page_break, static::$pages_content ),
]
);
}
/**
* Test retrieving page 1 content.
*/
public function test_view_page_1(): void {
query_posts(
[
'p' => static::$post_id,
]
);
$this->assertTrue( have_posts() );
while ( have_posts() ) {
the_post();
$this->assertEquals( static::$pages_content[1], get_the_content() );
}
}
/**
* Test retrieving page 2 content.
*/
public function test_view_page_2(): void {
query_posts(
[
'p' => static::$post_id,
'page' => 2,
]
);
$this->assertTrue( have_posts() );
while ( have_posts() ) {
the_post();
$this->assertEquals( static::$pages_content[2], get_the_content() );
}
}
/**
* Test retrieving page 3 content.
*/
public function test_view_page_3(): void {
query_posts(
[
'p' => static::$post_id,
'page' => 3,
]
);
$this->assertTrue( have_posts() );
while ( have_posts() ) {
the_post();
$this->assertEquals( static::$pages_content[3], get_the_content() );
}
}
/**
* Test retrieving "view all" contents.
*/
public function test_view_all(): void {
query_posts(
[
'p' => static::$post_id,
'view-all' => true,
]
);
$this->assertTrue( have_posts() );
while ( have_posts() ) {
the_post();
$content = get_the_content();
foreach ( static::$pages_content as $page => $text ) {
$this->assertContains( $text, $content, "Failed to assert that content contained page {$page}." );
}
}
}
}
<?php
/**
* Class SampleTest
*
* @package View_All_Posts_Pages
*/
/**
* Sample test case.
*/
class SampleTest extends WP_UnitTestCase {
/**
* A single example test.
*/
public function test_sample() {
// Replace this with some actual testing code.
$this->assertTrue( true );
}
}
......@@ -9,7 +9,7 @@
* Author URI: http://www.oomphinc.com/
* Text Domain: view_all_posts_pages
* Domain Path: /languages
* Version: 0.9.2
* Version: 0.9.3
*
* @package View_All_Posts_Pages
*
......@@ -754,7 +754,7 @@ class view_all_posts_pages { // phpcs:ignore PEAR.NamingConventions.ValidClassNa
/* translators: 1: URL to dismiss admin notice. */
printf( wp_kses_post( __( 'When finished, click <a href="%s">here</a> to hide this message.', 'view_all_posts_pages' ) ), esc_url( admin_url( add_query_arg( $query_args, 'index.php' ) ) ) );
?>
?>
</p>
</div>
......@@ -762,7 +762,6 @@ class view_all_posts_pages { // phpcs:ignore PEAR.NamingConventions.ValidClassNa
endif;
}
}
view_all_posts_pages::get_instance();
/**
* Alias global variable used to hold instantiated plugin prior to singleton's introduction in version 0.7.
......