84% simple-wp-content-protector

Code Review | Simple Wp Content Protector

WordPress plugin Simple Wp Content Protector scored84%from 54 tests.

About plugin

  • Plugin page: simple-wp-content...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Apr 12, 2023
  • Latest release: May 13, 2023
  • Number of updates: 14
  • Update frequency: every 2.4 days
  • Top authors: rajubdpro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /402 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Simple Wp Content Protector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.58 ▼5.62
Dashboard /wp-admin3.33 ▲0.0247.01 ▲0.18
Posts /wp-admin/edit.php3.38 ▲0.0248.86 ▲1.36
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.71 ▼3.24
Media Library /wp-admin/upload.php3.25 ▲0.0236.71 ▲3.87
Simple Wp Content Protector /wp-admin/options-general.php?page=simple_content_protector3.2131.59

Server storage [IO: ▲0.01MB] [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: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Simple Wp Content Protector: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7813.56 ▼0.741.83 ▼0.3538.40 ▼9.25
Dashboard /wp-admin2,206 ▲185.75 ▼0.15106.21 ▲0.2038.34 ▼4.51
Posts /wp-admin/edit.php2,092 ▲32.03 ▼0.0236.19 ▼2.3239.04 ▲4.81
Add New Post /wp-admin/post-new.php1,519 ▲517.35 ▼0.15673.93 ▲11.3553.24 ▼12.70
Media Library /wp-admin/upload.php1,394 ▲94.18 ▼0.0398.80 ▼4.4543.03 ▲0.47
Simple Wp Content Protector /wp-admin/options-general.php?page=simple_content_protector8342.0523.1132.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/simple-wp-content-protector/simple-wp-content-protector.php
    • > /wp-content/plugins/simple-wp-content-protector/admin/admin.php

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === simple-wp-content-protector === )
You can take inspiration from this readme.txt

simple-wp-content-protector/simple-wp-content-protector.php 92% from 13 tests

The main file in "Simple Wp Content Protector" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 153 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin190 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2202495
CSS24049
JavaScript12346

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods375.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin