10% lemonberry-page-protect

Code Review | Lemonberry Page Protect

WordPress plugin Lemonberry Page Protect scored10%from 54 tests.

About plugin

  • Plugin page: lemonberry-page-p...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 6.3.1
  • First release: May 3, 2014
  • Latest release: May 14, 2014
  • Number of updates: 6
  • Update frequency: every 2.5 days
  • Top authors: SimonHall (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,698 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/lemonberry-page-protect/lb-page-protect.php+15
    Undefined variable: wpdb

Server metrics [RAM: ▼0.28MB] [CPU: ▼18.17ms] Passed 4 tests

This is a short check of server-side resources used by Lemonberry Page Protect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.63 ▲1.07
Dashboard /wp-admin3.37 ▲0.0246.28 ▼12.43
Posts /wp-admin/edit.php3.42 ▲0.0645.45 ▼0.62
Add New Post /wp-admin/post-new.php4.66 ▼1.2343.49 ▼60.15
Media Library /wp-admin/upload.php3.29 ▲0.0635.83 ▲0.52
Page Protect /wp-admin/options-general.php?page=page-protect-options3.2326.67

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 2 new files
Database: 1 new table, 6 new options
New tables
wp_lb_page_protect
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Lemonberry Page Protect
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.24 ▼1.161.81 ▲0.1238.59 ▼0.59
Dashboard /wp-admin2,213 ▲225.89 ▲1.0095.08 ▼6.3638.76 ▼5.24
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0240.14 ▲3.6835.58 ▲1.66
Add New Post /wp-admin/post-new.php1,545 ▲1718.31 ▲0.25658.79 ▲58.3157.08 ▲7.72
Media Library /wp-admin/upload.php1,392 ▲44.24 ▲0.05101.74 ▲1.0144.53 ▲1.65
Page Protect /wp-admin/options-general.php?page=page-protect-options7672.0224.3426.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_lb_page_protect
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=page-protect-options
    • > Warning in wp-content/plugins/lemonberry-page-protect/lb-page-protect.php+255
    sort() expects parameter 1 to be array, bool given
    • > GET request to /wp-admin/options-general.php?page=page-protect-options
    • > Notice in wp-content/plugins/lemonberry-page-protect/lb-page-protect.php+305
    Trying to access array offset on value of type bool

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/lemonberry-page-protect/lb-page-protect.php on line 15
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/lemonberry-page-protect/lb-page-protect.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/lemonberry-page-protect/lb-page-protect.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Not available... yet) image required
  • Plugin Name: Please specify the plugin name on the first line ( === lemonberry-page-protect === )
You can look at the official readme.txt

lemonberry-page-protect/lb-page-protect.php 92% from 13 tests

This is the main PHP file of "Lemonberry Page Protect" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("lemonberry-page-protect.php" instead of "lb-page-protect.php")

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
Everything looks great! No dangerous files found in this plugin335 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14953335

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions15
▷ Named functions15100.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
PNG images were not found in this plugin