89% amazing-related-post

Code Review | Amazing Related Post

WordPress plugin Amazing Related Post scored89%from 54 tests.

About plugin

  • Plugin page: amazing-related-post
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.9.1
  • WordPress version: 6.3.1
  • First release: Apr 13, 2022
  • Latest release: Apr 20, 2022
  • Number of updates: 23
  • Update frequency: every 0.4 days
  • Top authors: khalilalsous (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /658 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.87ms] Passed 4 tests

This is a short check of server-side resources used by Amazing Related Post
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.89 ▼0.28
Dashboard /wp-admin3.36 ▲0.0551.13 ▲3.75
Posts /wp-admin/edit.php3.41 ▲0.0545.82 ▲2.03
Add New Post /wp-admin/post-new.php5.94 ▲0.0581.71 ▼8.55
Media Library /wp-admin/upload.php3.28 ▲0.0535.18 ▲3.30

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Amazing Related Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7114.48 ▲0.101.77 ▲0.1442.28 ▲1.15
Dashboard /wp-admin2,222 ▲345.79 ▼0.02100.64 ▼1.8438.45 ▼6.15
Posts /wp-admin/edit.php2,105 ▲162.16 ▲0.1035.31 ▲3.1433.00 ▼5.66
Add New Post /wp-admin/post-new.php1,527 ▲1017.68 ▲0.06646.07 ▼19.2055.12 ▲1.77
Media Library /wp-admin/upload.php1,404 ▲134.21 ▼0.0591.56 ▼4.8243.33 ▲0.13

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
4 plugin tags: category, post, post type, related post

amazing-related-post/index.php 85% from 13 tests

The main PHP file in "Amazing Related Post" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("amazing-related-post.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected548 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP34323280
CSS2206139
Sass133115
SVG10014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 1.38MB with 0.96MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png87.64KB29.30KB▼ 66.56%
assets/banner-1544x500.png226.78KB80.32KB▼ 64.58%
assets/screenshot-2.png394.91KB96.38KB▼ 75.60%
assets/screenshot-3.PNG143.23KB39.75KB▼ 72.24%
assets/screenshot-1.png229.62KB69.56KB▼ 69.71%