67% related-articles

Code Review | Related Articles

WordPress plugin Related Articles scored67%from 54 tests.

About plugin

  • Plugin page: related-articles
  • Plugin version: %s by %s', 'SL_frame...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 3, 2012
  • Latest release: Jun 30, 2023
  • Number of updates: 54
  • Update frequency: every 78.7 days
  • Top authors: sedLex (96.3%)kaizencoders (5.56%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active /10,021 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.43ms] Passed 4 tests

Analyzing server-side resources used by Related Articles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.75 ▼8.75
Dashboard /wp-admin3.31 ▼0.0444.72 ▼16.09
Posts /wp-admin/edit.php3.36 ▲0.0046.24 ▼3.56
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.26 ▼0.39
Media Library /wp-admin/upload.php3.23 ▲0.0032.95 ▼1.30

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 168 new files
Database: 1 new table, 6 new options
New tables
wp_pluginSL_related_articles
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Related Articles
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.25 ▼0.101.69 ▼0.1335.79 ▼7.82
Dashboard /wp-admin2,195 ▲215.62 ▲0.1197.06 ▼5.8443.92 ▼0.18
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0240.86 ▲1.4334.64 ▼1.21
Add New Post /wp-admin/post-new.php1,535 ▲923.28 ▲0.02650.39 ▼13.0760.43 ▲12.14
Media Library /wp-admin/upload.php1,394 ▼64.18 ▲0.0497.58 ▼36.3939.79 ▼10.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method related_articles::uninstall_removedata() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/related-articles/core.class.php
    • > /wp-content/plugins/related-articles/core.php
    • > /wp-content/plugins/related-articles/related-articles.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(core.php): failed to open stream: No such file or directory in wp-content/plugins/related-articles/core/templates/my-plugin.php on line 18
    • > PHP Fatal error
      require_once(): Failed opening required 'core.php' (include_path='.:/usr/share/php') in wp-content/plugins/related-articles/core/templates/my-plugin.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Configuration page), #2 (Examples), #3 (Related content is displayed in page)
Please take inspiration from this readme.txt

related-articles/core.class.php 85% from 13 tests

"Related Articles" version %s by %s', 'SL_frame...'s main PHP file describes plugin functionality and also serves as the entry point to any WordPress 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 ("related-articles.php" instead of "core.class.php")
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "%s by %s', 'SL_frame...")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin17,383 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PO File374,04408,877
PHP191,0141,8567,154
JavaScript5206229778
CSS108513459
Markdown120084
JSON10029
INI2002

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 119)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity51.55
▷ Minimum class complexity1.00
▷ Maximum class complexity211.00
Average method complexity7.13
▷ Minimum method complexity1.00
▷ Maximum method complexity119.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes15.00%
▷ Concrete classes1995.00%
▷ Final classes00.00%
Methods165
▷ Static methods3521.21%
▷ Public methods16298.18%
▷ Protected methods31.82%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
36 PNG files occupy 0.45MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/img/tab_doc.png0.82KB0.84KB0.00%
core/img/tree_lastnode_plus.png0.14KB0.12KB▼ 14.97%
core/img/valid.png4.34KB1.51KB▼ 65.32%
img/icon-128x128.png9.20KB5.09KB▼ 44.72%
core/img/arrow_down.png0.27KB0.27KB0.00%