10% content-protect-by-time-lock

Code Review | Content Protect By Time Lock

WordPress plugin Content Protect By Time Lock scored10%from 54 tests.

About plugin

  • Plugin page: content-protect-b...
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Sep 3, 2014
  • Latest release: Sep 15, 2014
  • Number of updates: 7
  • Update frequency: every 1.9 days
  • Top authors: MTserve (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,406 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/content-protect-by-time-lock/WP_ContentProtect.php+79
    Trying to access array offset on value of type bool

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

Analyzing server-side resources used by Content Protect By Time Lock
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0345.36 ▲2.30
Dashboard /wp-admin3.34 ▼0.0146.87 ▼8.11
Posts /wp-admin/edit.php3.45 ▲0.1049.18 ▼3.50
Add New Post /wp-admin/post-new.php5.92 ▲0.0496.10 ▼11.19
Media Library /wp-admin/upload.php3.26 ▲0.0334.62 ▲0.68
Content Protect /wp-admin/options-general.php?page=Wp_ContentProtect3.2529.48

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Content Protect By Time Lock
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▼0.081.70 ▼0.1340.81 ▼4.07
Dashboard /wp-admin2,210 ▲224.86 ▼0.99106.50 ▲3.8641.16 ▼2.80
Posts /wp-admin/edit.php2,098 ▲62.00 ▼0.0138.89 ▼2.3034.79 ▼2.57
Add New Post /wp-admin/post-new.php1,532 ▲1817.98 ▲0.35671.58 ▲61.8661.53 ▲1.99
Media Library /wp-admin/upload.php1,392 ▲74.15 ▼0.0492.98 ▼4.5043.97 ▼1.45
Content Protect /wp-admin/options-general.php?page=Wp_ContentProtect8322.0423.9927.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% 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 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 items
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/content-protect-by-time-lock/admin/protect_again_form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/content-protect-by-time-lock/admin/settings_page.php:7
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/content-protect-by-time-lock/admin/control_metabox.php on line 4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/content-protect-by-time-lock/admin/protect_setup_form.php:5
    • > PHP Notice
      Trying to get property 'post_status' of non-object in wp-content/plugins/content-protect-by-time-lock/admin/control_metabox.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/content-protect-by-time-lock/admin/protect_alter_form.php:5
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/content-protect-by-time-lock/admin/control_metabox.php on line 16
    • > PHP Notice
      Trying to get property 'post_status' of non-object in wp-content/plugins/content-protect-by-time-lock/admin/control_metabox.php on line 16
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/content-protect-by-time-lock/admin/protect_setup_form.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: menu, login, meta, author, widget...

content-protect-by-time-lock/WP_ContentProtect.php 92% from 13 tests

The main PHP file in "Content Protect By Time Lock" ver. 0.0.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("content-protect-by-time-lock.php" instead of "WP_ContentProtect.php")

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
Good job! No executable or dangerous file extensions detected594 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP642181426
PO File244128132
CSS33036

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity54.00
▷ Minimum class complexity54.00
▷ Maximum class complexity54.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods27
▷ Static methods311.11%
▷ Public methods2696.30%
▷ Protected methods13.70%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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