Git Product home page Git Product logo

studiohyperset / wordpress-pagination-plugin Goto Github PK

View Code? Open in Web Editor NEW
0.0 8.0 0.0 342 KB

WordPress pagination plugin. Paginate content easily & efficiently. | Page-Links Plus

CSS 3.37% JavaScript 3.43% PHP 93.20%
wordpress wordpress-plugin pagination pagination-control pagination-generator pagination-links pagination-component pagination-script pagination-functionality pagination-support

wordpress-pagination-plugin's People

Contributors

brunocantuaria avatar oqm4 avatar studiohypersetadmin avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-pagination-plugin's Issues

Add Universal Toggle for Pagination

In addition to opting pages and posts out in the page/post editor, allow users to set the default "Do Not Paginate" universally as well.

Use a Yoast like toggle. If on, can still exempt pages singly. If off, can still request single pages and posts be paginated.

From the user:

Yes, you can turn auto pagination on for specific pages. Unfortunately the default setting is “On”, so I had to go through each of my pre-existing pages and switch pagination off individually.

Controls Error

Pagination Controls has a problem. I put in the following:

  • Link Wrapper Element: span
  • Link Wrapper Element Class: page-numbers

In the HTML preview it appears to work correctly:

<span class="page-numbers"><a href="#">1</a></span>

However, the actual output on the site is:

<a href="https://mitty-walters.com/02stage/more-by-mitty/breaking-destiny-preview-css/1/"><span class="page-numbers">5</span></a>

As you can see, the wrappers get reversed. The should come before the .

Style Flexibility

This is a follow on to my need for a content container. It’s possible I might want to apply different styles to different content. It would be nice if I could assign the wrapper name uniquely, per page.

You already have this on individual pages:

unnamed

You could add a little dialogue that mentions the default name (“plp-on”) and then allow the input of an override.

Header Tags + URL Parameters

Does your plugin have a function that would split a WP Post into multiple pages by a specific number of h1 or h2 tags? Also, could that function be activated only via a php function in the post's url?

For example, I have an article with 15 h1 tags in it. Accessing the URL simply shows the article in one page. But when adding a function like "&view=list" at the end of the url would trigger said function and split the article accordingly.

PHP 7 Issue

When running PHP 7, a user reports the following:

First of all, it´s an awesome plugin! I bought the bundle of 4 plugins and everything works great.

The only problem is that the plugin is throwing an Undefined Index notice when debugging is turned on:

PHP Notice: Undefined index: page-links-single-page-option/page-links.php in /public/wp-content/plugins/page-links-single-page-option/page-links.php on line 160

A previous poster also had this issue and you recommended turning WP_DEBUG off.

However sometimes we need to debug other issues on our WP install and since your PLP throws a warning on every pageload it makes it difficult to troubleshoot other issues.

I hope you can have a look.

I´m using WP Multisite 4.5.2. with PHP 7.

https://wordpress.org/support/topic/undifined-index?replies=2#post-8529430

New Classes

Add unique classes to “nextpagelink”, “previouspagelink”, “firstpage”, “lastpage”, and Scroll Marker

Table of Contents

Another thing that would be handy, especially for authors: adding a table of contents.

This too would require a manual page break and would go something like this:

<!—bof-title-of-this-section-->
Chapter 1: Disappointment

Their would need to be a GUI on the page below the one you already have there:

unnamed-1

The GUI would ask if a Table of Contents should be activated. If yes, it would ask:
What is the title of this menu: “Table of Contents” (default setting; they could type in what they want)
Specify a css wrapper class: “.plp-toc” (default setting; they could type in what they want)
Where would you like the TOC to appear?
First page only; Every page; First page of every section?
Horizontally: Float left, right, or center?
Vertically: Fix top, bottom, or middle?

The drawback is that you’d have to allow for styling controls for people who can’t do css. Maybe this could be in settings, not page specific? If you are allowing them to override the default class within the page, advanced users could alter as they please.

But in the settings, you’d need to allow a user to style their little menu. Text size, color, weight, etc. And maybe let them create a box around the menu, specifying background, border, shadow, rounded corners, etc.

Fix default options

Hi,

We noticed a lot of notices when the plugin is activated and the user has not changed or saved any options from the Settings page.

Here are the notices:

[25-May-2020 22:58:22 UTC] PHP Deprecated:  Function create_function() is deprecated in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 29
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: scrolling_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 190
[25-May-2020 22:58:22 UTC] PHP Notice:  Trying to access array offset on value of type null in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 190
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: scrolling_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 191
[25-May-2020 22:58:22 UTC] PHP Notice:  Trying to access array offset on value of type null in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 191
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: scrolling_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 192
[25-May-2020 22:58:22 UTC] PHP Notice:  Trying to access array offset on value of type null in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 192
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: auto_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 194
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: auto_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 296
[25-May-2020 22:58:22 UTC] PHP Notice:  Trying to access array offset on value of type null in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 320
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: paragraph_count in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 487
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: paragraph_count in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 487
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: paragraph_count in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 487
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: paragraph_count in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 487
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: paragraph_count in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 487
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: pagination_styles in \wp-content\plugins\page-links-single-page-option\addons\pagination-styles\pagination-styles-functions.php on line 46
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined variable: link_wrapper_outter in \wp-content\plugins\page-links-single-page-option\addons\pagination-styles\pagination-styles-functions.php on line 81
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: scrolling_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 190
[25-May-2020 22:58:22 UTC] PHP Notice:  Trying to access array offset on value of type null in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 190
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: scrolling_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 191
[25-May-2020 22:58:22 UTC] PHP Notice:  Trying to access array offset on value of type null in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 191
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: scrolling_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 192
[25-May-2020 22:58:22 UTC] PHP Notice:  Trying to access array offset on value of type null in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 192
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: auto_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 194
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: auto_pagination in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 296
[25-May-2020 22:58:22 UTC] PHP Notice:  Trying to access array offset on value of type null in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 320
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: paragraph_count in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 487
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: paragraph_count in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 487
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: paragraph_count in \wp-content\plugins\page-links-single-page-option\addons\auto-pagination\auto-pagination-functions.php on line 487
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined index: pagination_styles in \wp-content\plugins\page-links-single-page-option\addons\pagination-styles\pagination-styles-functions.php on line 46
[25-May-2020 22:58:22 UTC] PHP Notice:  Undefined variable: link_wrapper_outter in \wp-content\plugins\page-links-single-page-option\addons\pagination-styles\pagination-styles-functions.php on line 81

The create_function() one is fixed in #18.

Allow Users to Toggle Off Pagination on Certain Pages/Posts

Use a checkbox in the PLP metabox to allow users to exempt certain pages and posts from pagination. If toggled on, the single page/post won't be paginated.

Note, on pages, the user will see "Don't paginate this page." On posts, s/he will see "Don't paginate this post."

screen shot 2018-07-05 at 12 03 52 pm

Responsive Pagination

Allow different chunk sizes based on device (Desktop: 500 words; Tablet: 350; Phone: 250).

++ Idea #7 +++
Making the Auto Pagination responsive: Allow device specific breaking points.

For instance, I am currently set to break pages at 500 words. But maybe 400 words on a tablet and 250 on a phone would be better?

One way to accomplish this would be to create two new tables (tablet, phone). When a user is editing a page and hits “UPDATE”, your normal pagination breakup routine occurs, but also a second and third routine occurs.

Then, on the front end, all three versions get output but “display:none;” gets applied to the unneeded versions.

Maybe that wouldn’t work? Or maybe there is an easier way?

More Pagination Choices

More choices for where the pagination links appear. Currently it appears below the paginated content, only.

Would be nice if I could choose:
• Below
• Above
• Above and Below

Additionally, it would be nice to do the same with the ‘Multi-Page’ Link Text. If somebody clicks Single Page view then changes their mind, they have to scroll all the way to the bottom in order to revert.

PHP Warning: Division by zero in …/scrolling-pagination-functions.php

From the WordPress plugin's support forum, about 6 months ago:

https://wordpress.org/support/topic/php-warning-division-by-zero-in-scrolling-pagination-functions-php/

I'm reposting it here because this is an extremely easy way to fix the above error, but if you prefer a PR, let me know (I'm lazy!).

Hi,

I’m getting this warning on my logs:

PHP Warning: Division by zero in /[full path to my WP installation]/wp-content/plugins/page-links-single-page-option/addons/scrolling-pagination/scrolling-pagination-functions.php on line 47

The affected function is generate_scrolling_pagination() and on line 47 we have:

$scrolls = $pages / $pages_per_scroll;

For some obscure reason, in my setup, sometimes $pages_per_scroll is zero, and so the division naturally fails.

A very quick & dirty fix is to simply change the above line to:

$scrolls = $pages / ($pages_per_scroll ?: 1);

but I guess there might be ‘cleaner’ ways to check why $pages_per_scroll is zero in some cases. I have to admit that your code is very clean and simple to read, but it would require me a lot of time to fully debug it.

In the meantime, if readers of this forum see the above message on their web server logs, as said, the quick & dirty fix will at least get rid of the message and do something sensible.

As a reference, my setup runs on Ubuntu 20.04.1 LTS, nginx/1.19.2 + php-fpm 7.4.10, WordPress is at the latest version, running the Customizr Pro theme, and major plugins are Jetpack, WordFence, and WP Fastest Cache (there are plenty of minor plugins as well, including a few of my own…). PHP 7.4+ is a bit stricter on a lot of functions, and it may be the reason why this warning started popping up 6 months ago. (note: this paragraph has been updated with my current setup)

Remove PLP Code

If you implement any of the ideas able, lots of users will be opening their pages in text view so that they can insert stuff. But all the code PLP adds makes this a very messy proposition.

For instance, PLP surrounds every line like this:

Three years ago

I imagine the code gets inserted when the “UPDATE” is clicked on. And there is probably no simple way to strip all that out on the way back. But it if there is a way to have this happen cleanly in the background right before the editor opens, that would be great.

The alternative would be to add a button that says:
Remove PLP Code

If the code was then stripped out but NOT sent back to the SQL table as if “UPDATE” had been pressed, the user would be presented with a much cleaner view of there code (in “text view”) making it easier to manually insert page breaks, etc., but no change will occur on the front-end yet.

Then, when the user finally decides to hit “UPDATE”, all the PLP code will get reinserted on the way back.

Insert Header

Allow the insertion of header to appear above each chunk of text. For instance, <!--header”My Book: Chapter 1”—>

This one would be HUGELY useful, especially for authors: The ability to add snippets above and below paginated content.

Here is my demo link again:
https://mitty-walters.com/02stage/more-by-mitty/breaking-destiny-preview-css/

As you can see, I added a blue box heading at the top. I’d like for something that to repeat above every paginated page.

I imagine it would work by opening the page editor, then adding something like this: eof-above-every-page

<!--bof-above-every-page-->
<h1 style="text-align: center;"><span class="test">Breaking Destiny Preview</span></h1>
<!--eof-above-every-page-->
<!--bof-below-every-page-->
<h3 style="text-align: center;"><span class=“random”>Available October 1, 2018. Click this here to preorder.</span></h3>
<!--eof-below-every-page-->

This is a follow on to #3: Allow things to be placed above or below specific sections.

For instance, I may want the name of the chapter to appear above every page each chapter. And then below, I may want to provide hot-links so that a reader could jump to a different chapter.

This would first require a manual page break and would end at the next manual page break. I imagine something like this:

<!--nextpage-->
<!--bof-above-this-section-->
<h1 style="text-align: center;"><span class=“random”>Chapter 1: Disappointment</span></h1>
<!--eof-above-this-section-->

<!—bof-below-this-section-->
List of links to chapters
<!—eof-below-this-section-->```

Btw, these would appear *inside* of the every-page tags created above in idea #3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.