84% c4d-related-post

Code Review | Related Post

WordPress plugin Related Post scored84%from 54 tests.

About plugin

  • Plugin page: c4d-related-post
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 17, 2017
  • Latest release: Nov 16, 2017
  • Number of updates: 14
  • Update frequency: every 19.4 days
  • Top authors: coffee4dev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /958 total downloads

Benchmarks

Plugin footprint 83% 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.00MB] [CPU: ▼6.48ms] Passed 4 tests

A check of server-side resources used by Related Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.86 ▼0.62
Dashboard /wp-admin3.32 ▼0.0353.17 ▼14.00
Posts /wp-admin/edit.php3.37 ▲0.0148.13 ▼1.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.36 ▼7.69
Media Library /wp-admin/upload.php3.24 ▲0.0133.47 ▼3.20

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Related Post
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.301.96 ▼0.2142.63 ▲2.39
Dashboard /wp-admin2,192 ▲145.53 ▼0.2198.06 ▼7.5245.69 ▲3.34
Posts /wp-admin/edit.php2,100 ▼31.99 ▼0.0335.26 ▼0.5935.51 ▼5.19
Add New Post /wp-admin/post-new.php1,528 ▲223.08 ▲0.05669.20 ▲52.6260.83 ▲4.31
Media Library /wp-admin/upload.php1,403 ▲34.20 ▼0.0195.43 ▼12.9645.77 ▲2.04

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: q in wp-content/plugins/c4d-related-post/templates/default.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/c4d-related-post/c4d-related-post.php:12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/c4d-related-post/templates/__item.php on line 2
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/c4d-related-post/templates/__item.php on line 2
    • > PHP Warning
      Division by zero in wp-content/plugins/c4d-related-post/templates/__item.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/c4d-related-post/templates/default.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/c4d-related-post/templates/__item.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
Please take inspiration from this readme.txt

c4d-related-post/c4d-related-post.php Passed 13 tests

The primary PHP file in "Related Post" version 2.0.3 is used by WordPress to initiate all plugin functionality
97 characters long description:
List related posts. Please install C4D Plugin Manager and Redux Framework to enable all features.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected92 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP315992

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected