68% page-whitelists

Code Review | Page Whitelists

WordPress plugin Page Whitelists scored 68% from 54 tests.

About plugin

  • Plugin page: page-whitelists
  • Plugin version: 4.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.6.1
  • WordPress version: 6.3.1
  • First release: Aug 10, 2014
  • Latest release: Apr 5, 2019
  • Number of updates: 102
  • Update frequency: every 16.7 days
  • Top authors: corvidism (97.06%)annathecrow (3.92%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 3,176 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.61ms] Passed 4 tests

A check of server-side resources used by Page Whitelists
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.23 ▼4.35
Dashboard /wp-admin3.34 ▲0.0446.47 ▼3.85
Posts /wp-admin/edit.php3.39 ▲0.0444.39 ▼0.39
Add New Post /wp-admin/post-new.php5.93 ▲0.0498.93 ▲2.45
Media Library /wp-admin/upload.php3.26 ▲0.0432.33 ▼1.84
Page Whitelists /wp-admin/options-general.php?page=wl_lists3.2629.39
Manage whitelists /wp-admin/users.php?page=wl_lists_manage3.2931.95

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: 2 new tables, 9 new options
New tables
wp_wl_list
wp_wl_list_page
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
wlist_list_page_table
wlist_settings
db_upgraded
wlist_list_table

Browser metrics Passed 4 tests

Page Whitelists: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲5113.54 ▼0.684.35 ▲2.2541.27 ▼4.87
Dashboard /wp-admin2,217 ▲284.84 ▼0.11108.07 ▼8.6842.06 ▼2.18
Posts /wp-admin/edit.php2,097 ▲112.04 ▲0.0640.61 ▲5.4036.32 ▲1.93
Add New Post /wp-admin/post-new.php1,551 ▲3718.54 ▲1.15600.74 ▼77.1550.88 ▼3.49
Media Library /wp-admin/upload.php1,393 ▲54.17 ▼0.0399.73 ▲0.9339.60 ▼4.11
Page Whitelists /wp-admin/options-general.php?page=wl_lists8002.0324.3425.37
Manage whitelists /wp-admin/users.php?page=wl_lists_manage8482.2129.9629.80

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
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/page-whitelists/uninstall.php+10
    Undefined variable: users_query
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • wlist_settings
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/page-whitelists/templates/metabox.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/page-whitelists/tests/test-WL_List.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/page-whitelists/tests/test-sample.php:3
    • > PHP Notice
      Undefined variable: all_wlists in wp-content/plugins/page-whitelists/templates/metabox.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/page-whitelists/templates/metabox.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/page-whitelists/templates/admin_page.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/page-whitelists/tests/X-test-general-WP-stuff.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/page-whitelists/page-whitelists.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/page-whitelists/templates/profile_field.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/page-whitelists/templates/lists_page.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/page-whitelists/tests/test-WL_Data.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: uam, admin tools, editing pages, limit access, pages...

page-whitelists/page-whitelists.php 92% from 13 tests

The principal PHP file in "Page Whitelists" v. 4.0.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 229 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin2,251 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP172581771,683
JavaScript23619336
PO File15057122
Markdown126060
CSS213050

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity25.50
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity3.01
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods122
▷ Static methods86.56%
▷ Public methods11795.90%
▷ Protected methods00.00%
▷ Private methods54.10%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/jstree/40px.png1.84KB1.84KB0.00%
templates/jstree/32px.png3.05KB2.88KB▼ 5.58%