10% wp-simple-related-posts

Code Review | WP Simple Related Posts

WordPress plugin WP Simple Related Posts scored10%from 54 tests.

About plugin

  • Plugin page: wp-simple-related...
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2014
  • Latest release: Sep 7, 2023
  • Number of updates: 63
  • Update frequency: every 55.1 days
  • Top authors: horike (85.71%)wokamoto (9.52%)tai (7.94%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /11,044 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/wp-simple-related-posts/simple-related-posts.php+97
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.17MB] [CPU: ▼5.08ms] Passed 4 tests

Server-side resources used by WP Simple Related Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1643.55 ▲3.25
Dashboard /wp-admin3.47 ▲0.1749.80 ▼0.18
Posts /wp-admin/edit.php3.59 ▲0.2348.80 ▼1.53
Add New Post /wp-admin/post-new.php6.07 ▲0.1887.68 ▼17.04
Media Library /wp-admin/upload.php3.40 ▲0.1735.43 ▼1.57
Simple Related Posts /wp-admin/options-general.php?page=simple_related_posts3.3732.24

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 30 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
sirp_options
widget_simple_related_posts_widget
widget_recent-comments
widget_recent-posts
simple_related_posts_installed

Browser metrics Passed 4 tests

An overview of browser requirements for WP Simple Related Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4814.73 ▲0.571.88 ▲0.3644.01 ▼0.81
Dashboard /wp-admin2,212 ▲325.70 ▲0.0492.76 ▼0.0838.15 ▼4.76
Posts /wp-admin/edit.php2,121 ▲182.24 ▲0.2837.21 ▼2.2838.73 ▲1.48
Add New Post /wp-admin/post-new.php6,283 ▲4,74618.95 ▼5.59932.23 ▲304.3962.59 ▼9.40
Media Library /wp-admin/upload.php1,420 ▲174.23 ▲0.07100.93 ▼0.6540.59 ▼3.33
Simple Related Posts /wp-admin/options-general.php?page=simple_related_posts9121.9526.8328.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • sirp_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • simple_related_posts_installed
    • widget_simple_related_posts_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-simple-related-posts/tests/test-wp_simple_related_posts.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-simple-related-posts/admin/options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-simple-related-posts/simple-related-posts.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Related_Posts_Base' not found in wp-content/plugins/wp-simple-related-posts/modules/tag.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_JSON_Posts' not found in wp-content/plugins/wp-simple-related-posts/lib/wp-rest-api.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Related_Posts_Base' not found in wp-content/plugins/wp-simple-related-posts/modules/category.php:2
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-simple-related-posts/tests/bootstrap.php on line 6
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/wp-simple-related-posts/tests/bootstrap.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-simple-related-posts/modules/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-simple-related-posts/modules/hook.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: related, related posts

wp-simple-related-posts/simple-related-posts.php 85% from 13 tests

The primary PHP file in "WP Simple Related Posts" version 1.6.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-simple-related-posts.php" instead of "simple-related-posts.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
Good job! No executable or dangerous file extensions detected1,929 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP1318533778
JavaScript310063709
CSS2110187
PO File25256146
Bourne Shell115459
Markdown17024
XML10014
YAML14012

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity9.60
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods49
▷ Static methods00.00%
▷ Public methods4897.96%
▷ Protected methods00.00%
▷ Private methods12.04%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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
images/remove.png0.36KB0.20KB▼ 44.35%
images/add.png0.31KB0.17KB▼ 45.63%