10% best-related-posts

Code Review | Best Related Posts

WordPress plugin Best Related Posts scored 10% from 54 tests.

About plugin

  • Plugin page: best-related-posts
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.9
  • WordPress version: 6.3.1
  • First release: Aug 27, 2009
  • Latest release: Apr 18, 2014
  • Number of updates: 50
  • Update frequency: every 34.0 days
  • Top authors: rmak78 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 23,965 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/best-related-posts/plugin.php+31
    Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.96MB] [CPU: ▼53.63ms] Passed 4 tests

Analyzing server-side resources used by Best Related Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.74 ▼36.99
Dashboard /wp-admin2.05 ▼1.266.52 ▼46.24
Posts /wp-admin/edit.php2.05 ▼1.316.09 ▼43.04
Add New Post /wp-admin/post-new.php2.05 ▼3.845.71 ▼88.24
Media Library /wp-admin/upload.php2.05 ▼1.185.20 ▼29.80
Best Related Posts /wp-admin/options-general.php?page=best-related-posts/options.php2.055.46

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Best Related Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.66 ▼0.722.14 ▲0.2443.08 ▼7.24
Dashboard /wp-admin2,210 ▲194.89 ▼0.01110.04 ▼9.2340.17 ▼7.84
Posts /wp-admin/edit.php2,096 ▲72.03 ▲0.0239.41 ▲2.7034.64 ▼0.31
Add New Post /wp-admin/post-new.php1,546 ▲1323.22 ▼0.07685.46 ▲25.0954.94 ▼12.04
Media Library /wp-admin/upload.php1,383 ▼54.24 ▲0.12104.06 ▼9.3442.01 ▼7.04
Best Related Posts /wp-admin/options-general.php?page=best-related-posts/options.php8612.0324.0025.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/best-related-posts/plugin.php+31
    Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • boposts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=best-related-posts/options.php
    • > Warning in wp-content/plugins/best-related-posts/plugin.php+31
    Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=best-related-posts/options.php
    • > Warning in wp-content/plugins/best-related-posts/plugin.php+31
    include(wp-content/plugins/best-related-posts/WPLANG_options.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=best-related-posts/options.php
    • > Warning in wp-content/plugins/best-related-posts/plugin.php+31
    include(): Failed opening 'wp-content/plugins/best-related-posts/WPLANG_options.php' for inclusion (include_path='.:/usr/share/php')
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=best-related-posts/options.php
    • > Notice in wp-content/plugins/best-related-posts/options.php+81
    Undefined variable: options
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=best-related-posts/options.php
    • > Notice in wp-content/plugins/best-related-posts/options.php+81
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/best-related-posts/options.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/best-related-posts/options.php on line 81
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/best-related-posts/options.php on line 50
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/best-related-posts/options.php on line 65
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/best-related-posts/options.php on line 56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/best-related-posts/plugin.php:33
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/best-related-posts/options.php on line 75
    • > PHP Warning
      Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP) in wp-content/plugins/best-related-posts/plugin.php on line 31
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/best-related-posts/options.php on line 75
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/best-related-posts/options.php on line 81
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/best-related-posts/options.php on line 65

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === best-related-posts === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Showing related posts to visitors.), #2 (Plugin Options Page for Admin.)
The official readme.txt is a good inspiration

best-related-posts/plugin.php 92% from 13 tests

The primary PHP file in "Best Related Posts" version 1.1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("best-related-posts.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected180 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34727180

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin