90% same-category-posts

Code Review | Same Category Posts

WordPress plugin Same Category Posts scored90%from 54 tests.

About plugin

  • Plugin page: same-category-posts
  • Plugin version: 1.1.18
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 27, 2015
  • Latest release: Mar 1, 2023
  • Number of updates: 124
  • Update frequency: every 21.9 days
  • Top authors: Kometschuh (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

4,000+ active /60,324 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼3.79ms] Passed 4 tests

An overview of server-side resources used by Same Category Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1938.52 ▼4.37
Dashboard /wp-admin3.50 ▲0.1947.38 ▼6.69
Posts /wp-admin/edit.php3.55 ▲0.1948.57 ▲0.29
Add New Post /wp-admin/post-new.php6.10 ▲0.2188.43 ▼4.37
Media Library /wp-admin/upload.php3.42 ▲0.1937.44 ▲1.08

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_same-category-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Same Category Posts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.61 ▼0.791.77 ▼0.2542.99 ▼2.23
Dashboard /wp-admin2,208 ▲175.85 ▼0.0399.32 ▼4.0836.98 ▼5.89
Posts /wp-admin/edit.php2,091 ▲22.04 ▲0.0136.33 ▲0.4032.50 ▼4.92
Add New Post /wp-admin/post-new.php1,535 ▲2123.24 ▲5.52684.64 ▼0.1264.50 ▲0.96
Media Library /wp-admin/upload.php1,393 ▲54.17 ▼0.11102.82 ▼4.6244.51 ▼1.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_same-category-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
5 plugin tags: products, custom post type, events, related, related posts

same-category-posts/same-category-posts.php Passed 13 tests

Analyzing the main PHP file in "Same Category Posts" version 1.1.18
70 characters long description:
Adds a widget that shows the most recent posts from a single category.

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
There were no executable files found in this plugin1,015 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1122139874
JavaScript1132282
CSS117459

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity177.00
▷ Minimum class complexity177.00
▷ Maximum class complexity177.00
Average method complexity17.00
▷ Minimum method complexity1.00
▷ Maximum method complexity99.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.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