10% wp-table-of-paginated-contents

Code Review | Author: António Andrade

WordPress plugin Author: António Andradescored10%from 54 tests.

About plugin

  • Plugin page: wp-table-of-pagin...
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.4
  • WordPress version: 6.3.1
  • First release: Mar 26, 2012
  • Latest release: Dec 19, 2015
  • Number of updates: 30
  • Update frequency: every 45.4 days
  • Top authors: antonioandra.de (90%)luc7v (13.33%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /11,408 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-table-of-paginated-contents/wp-table-of-paginated-contents.php+29
    Methods with the same name as their class will not be constructors in a future version of PHP; WPtopc has a deprecated constructor

Server metrics [RAM: ▼0.94MB] [CPU: ▼35.84ms] Passed 4 tests

This is a short check of server-side resources used by Author: António Andrade
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.46 ▼6.32
Dashboard /wp-admin3.00 ▼0.3021.78 ▼31.15
Posts /wp-admin/edit.php3.00 ▼0.3523.27 ▼26.49
Add New Post /wp-admin/post-new.php3.00 ▼2.8823.20 ▼73.62
Media Library /wp-admin/upload.php3.00 ▼0.2222.41 ▼12.11
Table of Paginated Contents /wp-admin/options-general.php?page=wp-table-of-paginated-contents/wp-table-of-paginated-contents.php3.0024.11

Server storage [IO: ▲0.14MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Author: António Andrade: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.75 ▲0.481.73 ▲0.0440.86 ▲2.28
Dashboard /wp-admin2,202 ▲255.64 ▼0.0483.73 ▼6.7436.81 ▼1.50
Posts /wp-admin/edit.php2,104 ▲11.94 ▼0.0433.83 ▼5.8732.32 ▲1.73
Add New Post /wp-admin/post-new.php1,534 ▲822.96 ▼0.25609.74 ▼16.1557.65 ▼15.20
Media Library /wp-admin/upload.php1,401 ▼24.16 ▲0.05100.37 ▲0.9044.79 ▲1.00
Table of Paginated Contents /wp-admin/options-general.php?page=wp-table-of-paginated-contents/wp-table-of-paginated-contents.php9511.8330.3140.60

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-table-of-paginated-contents/wp-table-of-paginated-contents.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=wp-table-of-paginated-contents/wp-table-of-paginated-contents.php
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method WPtopc::wptopc_page_style() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=wp-table-of-paginated-contents/wp-table-of-paginated-contents.php
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method WPtopc::wptopc_page_script() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=wp-table-of-paginated-contents/wp-table-of-paginated-contents.php
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method WPtopc::wptopc_page() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=wp-table-of-paginated-contents/wp-table-of-paginated-contents.php
    • > Notice in wp-content/plugins/wp-table-of-paginated-contents/wp-table-of-paginated-contents.php+175
    Undefined index: action

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-table-of-paginated-contents/index.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-table-of-paginated-contents/wp-table-of-paginated-contents-ui.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-table-of-paginated-contents/wp-table-of-paginated-contents-ui.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-table-of-paginated-contents/wp-table-of-paginated-contents.php:195

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The outputs (check the usage section).) image not found
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Author: António Andrade=== )
The official readme.txt is a good inspiration

wp-table-of-paginated-contents/wp-table-of-paginated-contents.php Passed 13 tests

This is the main PHP file of "Author: António Andrade" version 2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
109 characters long description:
Handles naming of each post page through a TinyMCE button and produces a Table of Contents for the said post.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected535 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP32230295
Sass1230103
CSS123079
JavaScript22158

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.11MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png32.24KB14.95KB▼ 53.64%
images/WPtopc.png0.47KB0.38KB▼ 18.37%
screenshot-3.png14.36KB7.78KB▼ 45.79%
images/antonioandra.de_favicon.png0.68KB0.76KB0.00%
screenshot-2.png62.45KB24.42KB▼ 60.89%