83% cp-related-posts

Code Review | CP Related Posts

WordPress plugin CP Related Posts scored83%from 54 tests.

About plugin

  • Plugin page: cp-related-posts
  • Plugin version: 1.0.46
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.3
  • WordPress version: 6.3.1
  • First release: Jan 31, 2014
  • Latest release: Jul 23, 2023
  • Number of updates: 98
  • Update frequency: every 35.3 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /49,347 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼0.66ms] Passed 4 tests

Server-side resources used by CP Related Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3147.33 ▲1.97
Dashboard /wp-admin3.62 ▲0.3155.45 ▼0.31
Posts /wp-admin/edit.php3.73 ▲0.3852.45 ▲1.04
Add New Post /wp-admin/post-new.php6.22 ▲0.3396.66 ▼5.33
Media Library /wp-admin/upload.php3.54 ▲0.3141.55 ▲7.67
CP Related Posts /wp-admin/options-general.php?page=cprp-settings3.5133.71

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
widget_cprpwidget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CP Related Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲11813.54 ▼0.718.60 ▲6.9045.49 ▲6.53
Dashboard /wp-admin2,196 ▲225.62 ▼0.0481.93 ▼7.5737.73 ▼7.92
Posts /wp-admin/edit.php2,112 ▲122.21 ▲0.2232.70 ▼6.8037.53 ▲2.83
Add New Post /wp-admin/post-new.php6,328 ▲4,80020.77 ▼2.47907.65 ▲245.6979.61 ▲28.86
Media Library /wp-admin/upload.php1,404 ▲74.17 ▼0.1798.87 ▼10.3145.33 ▼4.94
CP Related Posts /wp-admin/options-general.php?page=cprp-settings1,5712.1930.3440.44

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
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_cprpwidget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-related-posts/includes/banner.inc.php:106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-related-posts/includes/banner.inc.php:106

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 your attention:
  • Screenshots: A description for screenshot #7 is missing in cp-related-posts/assets to your readme.txt
  • Tags: There are too many tags (28 tag instead of maximum 10)
The official readme.txt is a good inspiration

cp-related-posts/cp-related-posts.php 92% from 13 tests

The primary PHP file in "CP Related Posts" version 1.0.46 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 182 characters long)

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
Everything looks great! No dangerous files found in this plugin2,073 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP42562881,742
PO File15555150
JavaScript3173115
CSS28366

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity32.00
▷ Minimum class complexity4.00
▷ Maximum class complexity86.00
Average method complexity5.43
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods1152.38%
▷ Public methods733.33%
▷ Protected methods00.00%
▷ Private methods1466.67%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/star_off.png0.46KB0.33KB▼ 28.21%
images/frame_on.png0.19KB0.08KB▼ 58.08%
images/ball_off.png0.70KB0.65KB▼ 6.42%
images/star_on.png0.42KB0.29KB▼ 28.94%
images/ball_on.png0.66KB0.65KB▼ 0.89%