77% wp-content-protection

Code Review | WP Content Protection

WordPress plugin WP Content Protection scored77%from 54 tests.

About plugin

  • Plugin page: wp-content-protec...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.1.1
  • WordPress version: 6.3.1
  • First release: Mar 26, 2015
  • Latest release: Oct 11, 2015
  • Number of updates: 19
  • Update frequency: every 10.5 days
  • Top authors: shankaranand12 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /5,515 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▼2.76ms] Passed 4 tests

This is a short check of server-side resources used by WP Content Protection
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0947.29 ▲3.28
Dashboard /wp-admin3.44 ▲0.1348.65 ▼1.72
Posts /wp-admin/edit.php3.54 ▲0.1846.92 ▲0.45
Add New Post /wp-admin/post-new.php6.15 ▲0.2681.69 ▼10.90
Media Library /wp-admin/upload.php3.38 ▲0.1534.99 ▲1.13
WP Content Protection /wp-admin/options-general.php?page=wp-content-protection3.3131.87

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
wpcp_post_type_settings
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

WP Content Protection: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲3914.79 ▲0.371.78 ▼0.2243.37 ▼1.23
Dashboard /wp-admin2,211 ▲204.88 ▼1.0199.51 ▼6.9536.77 ▼9.43
Posts /wp-admin/edit.php2,097 ▲82.03 ▲0.0440.10 ▲4.4134.82 ▲0.56
Add New Post /wp-admin/post-new.php6,270 ▲4,73725.81 ▲2.61977.92 ▲274.5766.23 ▲7.20
Media Library /wp-admin/upload.php1,393 ▲24.28 ▲0.06112.71 ▼0.9247.56 ▲1.30
WP Content Protection /wp-admin/options-general.php?page=wp-content-protection8922.1929.5726.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • wpcp_post_type_settings
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-content-protection/wp-content-protection.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-content-protection/include/wpcp-initfunctions.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-content-protection/admin/wpcp-setting-options.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-content-protection/include/wpcp-constant.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-content-protection/include/wpcp-generate-shortcode-mechanism.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-content-protection/admin/wpcp-metabox.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-content-protection/include/wpcp-content-protection-mechanism.php:44

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (screenshot-1.png : Show how many types of content protection mechanism on frontend.), #2 (screenshot-2.png : Show how many types of content protection on page in admin dashboard.), #3 (screenshot-3.png : Show the settings in admin dashboard.)
You can look at the official readme.txt

wp-content-protection/wp-content-protection.php 85% from 13 tests

This is the main PHP file of "WP Content Protection" version 1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 191 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected504 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9156307495
JavaScript11099
CSS1190

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity9.67
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
3 PNG files occupy 0.34MB with 0.20MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png121.23KB46.64KB▼ 61.53%
screenshot-2.png153.55KB58.52KB▼ 61.89%
screenshot-3.png70.03KB33.76KB▼ 51.79%