10% related-pages

Code Review | Related Pages

WordPress plugin Related Pages scored 10% from 54 tests.

About plugin

  • Plugin page: related-pages
  • Plugin version: 1.1.9.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-3.5.2
  • WordPress version: 5.8.1
  • First release: Jun 28, 2013
  • Latest release: Jun 28, 2013
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: janhvizdak (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 2,803 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+25
    Constant WP_POST_REVISIONS already defined

Server metrics [RAM: ▼0.83MB] [CPU: ▼170.29ms] Passed 4 tests

A check of server-side resources used by Related Pages
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.0945.38 ▲9.39
Dashboard /wp-admin2.82 ▼0.2328.83 ▼20.71
Posts /wp-admin/edit.php2.82 ▼0.2828.82 ▼13.30
Add New Post /wp-admin/post-new.php2.82 ▼2.6131.65 ▼627.95
Media Library /wp-admin/upload.php2.82 ▼0.1827.28 ▼19.21
Related Pages /wp-admin/tools.php?page=relatedpages2.8228.17

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: 4 new tables, no new options
New tables
wp_rpd_titles
wp_rpd_related_pages
wp_rpd_relations
wp_rpd_settings

Browser metrics Passed 4 tests

An overview of browser requirements for Related Pages
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,838 ▲25617.25 ▲1.2511.71 ▲0.3545.40 ▼10.04
Dashboard /wp-admin3,128 ▲1947.82 ▲1.72170.54 ▲22.13114.46 ▲2.46
Posts /wp-admin/edit.php2,821 ▲823.67 ▲0.9692.46 ▲22.24108.08 ▲20.92
Add New Post /wp-admin/post-new.php1,487 ▼18514.83 ▼3.94319.25 ▼61.7161.35 ▼50.62
Media Library /wp-admin/upload.php1,829 ▲226.48 ▲1.48174.06 ▲10.31121.74 ▼1.65
Related Pages /wp-admin/tools.php?page=relatedpages1,5353.2085.33123.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5495
    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 plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_rpd_related_pages
    • wp_rpd_relations
    • wp_rpd_settings
    • wp_rpd_titles

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > User deprecated in wp-includes/functions.php+5495
    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/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+204
    Undefined index: zmaz_id
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+213
    Undefined index: mod_url
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+214
    Undefined index: mod_name
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+215
    Undefined index: mod_trieda
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+216
    Undefined index: mod_attr
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+217
    Undefined index: mod_ciel
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+218
    Undefined index: mod_id
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+231
    Undefined index: rpd_url
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+232
    Undefined index: rpd_name
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+233
    Undefined index: rpd_attr
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+234
    Undefined index: rpd_trgt
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+235
    Undefined index: rpd_class
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Notice in wp-content/plugins/related-pages/relatedpages.php+247
    Undefined index: def_titul

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/related-pages/relatedpages.php on line 30
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/related-pages/relatedpages.php on line 32
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/related-pages/relatedpages.php on line 29
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/related-pages/relatedpages.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/related-pages/relatedpages.php:168

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Javascript (severe) in unknown
    /wp-admin/tools.php?page=relatedpages 246:40 Uncaught TypeError: Cannot read properties of null (reading 'style')
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Javascript (warning) in unknown
    https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js?ver=1.9.0 30 A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Javascript (warning) in unknown
    https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js?ver=1.9.0 30 A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Javascript (warning) in unknown
    https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js?ver=1.9.0 30 A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Javascript (warning) in unknown
    https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js?ver=1.9.0 30 A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Javascript (warning) in unknown
    https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js?ver=1.9.0 30 A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
    • > GET request to /wp-admin/tools.php?page=relatedpages
    • > Javascript (warning) in unknown
    https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js?ver=1.9.0 30 A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === related-pages === )
The official readme.txt is a good inspiration

related-pages/relatedpages.php 92% from 13 tests

The principal PHP file in "Related Pages" v. 1.1.9.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("related-pages.php" instead of "relatedpages.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin802 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP112992557
CSS2252168
JavaScript1101677

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin