78% wp-content-permission

Code Review | WP Content Permission

WordPress plugin WP Content Permission scored 78% from 54 tests.

About plugin

  • Plugin page: wp-content-permis...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: Jan 23, 2014
  • Latest release: Dec 8, 2016
  • Number of updates: 10
  • Update frequency: every 105.1 days
  • Top authors: orenhav (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active / 3,199 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.94ms] Passed 4 tests

Server-side resources used by WP Content Permission
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.71 ▼3.05
Dashboard /wp-admin3.40 ▲0.0942.87 ▼7.49
Posts /wp-admin/edit.php3.43 ▲0.0846.04 ▲2.54
Add New Post /wp-admin/post-new.php6.09 ▲0.2076.20 ▼13.53
Media Library /wp-admin/upload.php3.33 ▲0.1129.98 ▼7.67
WP Content Permission /wp-admin/options-general.php?page=wp-content-permission3.2933.81

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Content Permission
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲18913.94 ▼0.475.58 ▲3.7042.96 ▼3.78
Dashboard /wp-admin2,216 ▲285.81 ▲0.9199.04 ▼15.8940.49 ▼4.87
Posts /wp-admin/edit.php2,104 ▲122.05 ▲0.0735.89 ▼0.1439.32 ▲2.40
Add New Post /wp-admin/post-new.php6,479 ▲4,96020.02 ▼3.37915.76 ▲209.1452.89 ▼26.25
Media Library /wp-admin/upload.php1,407 ▲194.25 ▲0.0796.65 ▼9.2642.48 ▼4.99
WP Content Permission /wp-admin/options-general.php?page=wp-content-permission9192.1922.6930.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-content-permission/public/views/public.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-content-permission/admin/includes/ohmem-settings.php:139
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-content-permission/admin/views/admin.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: block content, private area, restricted content, memebers

wp-content-permission/plugin.php 85% from 13 tests

"WP Content Permission" version 1.2'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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-content-permission.php" instead of "plugin.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin479 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP8175446467
JavaScript28210
CSS2022

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity14.00
▷ Minimum class complexity5.00
▷ Maximum class complexity21.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods42
▷ Static methods716.67%
▷ Public methods3788.10%
▷ Protected methods00.00%
▷ Private methods511.90%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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