83% mighty-content-locker

Code Review | Mighty Content Locker

WordPress plugin Mighty Content Locker scored83%from 54 tests.

About plugin

  • Plugin page: mighty-content-lo...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-3.5.1
  • WordPress version: 6.3.1
  • First release: Mar 10, 2013
  • Latest release: Mar 10, 2013
  • Number of updates: 15
  • Update frequency: N/A
  • Top authors: innocoders (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,803 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.01MB] [CPU: ▼6.33ms] Passed 4 tests

Analyzing server-side resources used by Mighty Content Locker
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.16 ▼6.59
Dashboard /wp-admin3.32 ▲0.0145.79 ▼5.58
Posts /wp-admin/edit.php3.37 ▲0.0146.41 ▲0.21
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.89 ▼13.35
Media Library /wp-admin/upload.php3.24 ▲0.0137.71 ▲3.63

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 5 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

Mighty Content Locker: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲11714.50 ▲0.032.18 ▲0.1643.18 ▼5.33
Dashboard /wp-admin2,224 ▲365.82 ▲0.96101.42 ▼14.9460.69 ▲14.17
Posts /wp-admin/edit.php2,104 ▲152.02 ▼0.0237.93 ▲0.5834.60 ▼1.20
Add New Post /wp-admin/post-new.php1,680 ▲16322.41 ▲4.75680.05 ▲3.7256.84 ▼2.98
Media Library /wp-admin/upload.php1,403 ▲124.12 ▼0.09100.38 ▲7.3374.70 ▲35.14

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/mighty-content-locker/wpmcl.php:12

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: Plugin contributors not specified
The official readme.txt is a good inspiration

mighty-content-locker/wpmcl.php 85% from 13 tests

"Mighty Content Locker" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 182 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mighty-content-locker.php" instead of "wpmcl.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected110 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11910110

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png43.76KB15.50KB▼ 64.57%
wpmcl16.png0.67KB0.63KB▼ 6.39%
wpmcl.png4.38KB1.47KB▼ 66.29%