83% role-wise-category-post

Code Review | Role wise category post

WordPress plugin Role wise category post scored83%from 54 tests.

About plugin

  • Plugin page: role-wise-categor...
  • Plugin version: 1...
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 12, 2019
  • Latest release: Nov 14, 2019
  • Number of updates: 13
  • Update frequency: every 0.2 days
  • Top authors: innowyn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /497 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 gracefully, with no errors

Server metrics [RAM: ▼0.55MB] [CPU: ▼32.18ms] Passed 4 tests

A check of server-side resources used by Role wise category post
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.80 ▼0.6616.75 ▼29.72
Dashboard /wp-admin3.24 ▼0.1045.68 ▼20.93
Posts /wp-admin/edit.php3.17 ▼0.1832.98 ▼18.80
Add New Post /wp-admin/post-new.php4.64 ▼1.2546.67 ▼59.28
Media Library /wp-admin/upload.php3.27 ▲0.0441.81 ▲5.83

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Role wise category post
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.34 ▼0.011.80 ▼0.2951.48 ▲9.04
Dashboard /wp-admin2,210 ▲365.56 ▲0.0382.65 ▼11.4235.47 ▼9.78
Posts /wp-admin/edit.php2,121 ▲211.99 ▲0.0136.43 ▼2.0534.31 ▼0.19
Add New Post /wp-admin/post-new.php1,543 ▲623.19 ▲4.92667.30 ▲16.2959.76 ▼9.48
Media Library /wp-admin/upload.php1,415 ▲154.18 ▲0.00102.58 ▼3.1049.15 ▼1.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

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
Even though no errors were found, 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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/role-wise-category-post/Role-wise-category-post.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function body_class() in wp-content/plugins/role-wise-category-post/category-dashboard.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: shortcode, post, restriction, category

role-wise-category-post/Role-wise-category-post.php 77% from 13 tests

"Role wise category post" version 1...'s main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Version: Plugin version number should only contain digits separated by dots (ex. "1.0.3" instead of "1...")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("role-wise-category-post.php" instead of "Role-wise-category-post.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 190 characters long)

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
Good job! No executable or dangerous file extensions detected441 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP225514363
CSS2124178

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 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%
Functions12
▷ Named functions12100.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 images were found in this plugin