84% simple-category-ranking

Code Review | Simple Category Ranking

WordPress plugin Simple Category Ranking scored84%from 54 tests.

About plugin

  • Plugin page: simple-category-r...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.0.0
  • WordPress version: 6.3.1
  • First release: Nov 9, 2018
  • Latest release: Dec 8, 2018
  • Number of updates: 6
  • Update frequency: every 5.0 days
  • Top authors: ryokurosu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /710 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼9.12ms] Passed 4 tests

A check of server-side resources used by Simple Category Ranking
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0428.44 ▼12.58
Dashboard /wp-admin3.35 ▲0.0548.54 ▼1.40
Posts /wp-admin/edit.php3.40 ▲0.0443.66 ▼1.87
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.38 ▼20.63
Media Library /wp-admin/upload.php3.28 ▲0.0432.98 ▲3.78

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: 6 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_scr
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Simple Category Ranking: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲3113.23 ▼1.431.73 ▼0.3643.40 ▼0.79
Dashboard /wp-admin2,206 ▲245.85 ▲0.95100.07 ▼1.1844.51 ▼0.02
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0934.57 ▲0.0934.61 ▲1.62
Add New Post /wp-admin/post-new.php1,519 ▲123.42 ▲0.11651.53 ▲21.9046.66 ▼5.04
Media Library /wp-admin/upload.php1,382 ▼94.22 ▼0.03100.29 ▲3.0546.11 ▲2.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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_scr
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-category-ranking/simple-category-ranking.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simple-category-ranking/includes/class-simple-category-ranking.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: category, ranking, popular post

simple-category-ranking/simple-category-ranking.php Passed 13 tests

This is the main PHP file of "Simple Category Ranking" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
46 characters long description:
This is a better way to show category ranking.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected210 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP34461175
CSS11035

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.50
▷ Minimum class complexity7.00
▷ Maximum class complexity14.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin