78% related-posts-on-404-page

Code Review | 404 Related Posts

WordPress plugin 404 Related Posts scored78%from 54 tests.

About plugin

  • Plugin page: related-posts-on-...
  • Plugin version: 1.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Sep 16, 2020
  • Latest release: Mar 7, 2021
  • Number of updates: 7
  • Update frequency: every 24.6 days
  • Top authors: ahmadkarim (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /439 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.63ms] Passed 4 tests

An overview of server-side resources used by 404 Related Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0842.26 ▼0.96
Dashboard /wp-admin3.38 ▲0.0851.34 ▼6.33
Posts /wp-admin/edit.php3.50 ▲0.1454.05 ▲2.76
Add New Post /wp-admin/post-new.php5.96 ▲0.0887.95 ▼8.22
Media Library /wp-admin/upload.php3.31 ▲0.0838.20 ▼3.00
404 Related Posts /wp-admin/options-general.php?page=rpp_settings3.2835.44

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 30 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
rpp_activation_time
rpp_post_types
db_upgraded
rpp_hide_admin_notice
rpp_display_notice_time
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for 404 Related Posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.001.85 ▲0.2941.42 ▼3.31
Dashboard /wp-admin2,196 ▲195.64 ▲0.0484.43 ▼5.6938.35 ▼9.14
Posts /wp-admin/edit.php2,104 ▲41.97 ▼0.0537.07 ▲1.5933.17 ▼1.69
Add New Post /wp-admin/post-new.php1,540 ▲1417.91 ▼5.16603.26 ▼90.5176.00 ▲20.56
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.0596.67 ▼22.5243.71 ▼4.64
404 Related Posts /wp-admin/options-general.php?page=rpp_settings1,0022.0423.0247.45

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 10 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • rpp_post_types
    • rpp_hide_admin_notice
    • rpp_display_notice_time
    • widget_recent-posts
    • rpp_activation_time

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/related-posts-on-404-page/admin/partials/signup-form.php
    • > /wp-content/plugins/related-posts-on-404-page/templates/404-related-posts.php
    • > /wp-content/plugins/related-posts-on-404-page/admin/partials/buy-coffee-button.php
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: errors in wp-content/plugins/related-posts-on-404-page/admin/partials/settings.php on line 27
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/related-posts-on-404-page/admin/partials/settings.php on line 35
    • > PHP Notice
      Undefined variable: action in wp-content/plugins/related-posts-on-404-page/admin/partials/settings.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Rpp_buy_coffee() in wp-content/plugins/related-posts-on-404-page/admin/partials/sidebar.php:54
    • > PHP Notice
      Undefined variable: success in wp-content/plugins/related-posts-on-404-page/admin/partials/settings.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Rpp_buy_coffee() in wp-content/plugins/related-posts-on-404-page/admin/partials/sidebar.php:54
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/related-posts-on-404-page/admin/partials/settings.php on line 55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/related-posts-on-404-page/admin/partials/notice-info.php:19
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/related-posts-on-404-page/admin/partials/settings.php on line 27
    • > PHP Warning
      Use of undefined constant RPP_KOFI_LINK - assumed 'RPP_KOFI_LINK' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-posts-on-404-page/admin/partials/buy-coffee-button.php on line 21

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 Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: related content, 404 page, related links, posts, related posts...

related-posts-on-404-page/wp-404-related-posts.php 85% from 13 tests

This is the main PHP file of "404 Related Posts" version 1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("related-posts-on-404-page.php" instead of "wp-404-related-posts.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 202 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected926 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP18371349794
CSS1255124
JavaScript1708

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.67
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods26
▷ Static methods1350.00%
▷ Public methods1350.00%
▷ Protected methods00.00%
▷ Private methods1350.00%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants3
▷ Global constants3100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png1.71KB0.83KB▼ 51.55%
assets/icon-256x256.png1.85KB0.75KB▼ 59.39%