83% data-access-levels

Code Review | Data access levels

WordPress plugin Data access levels scored83%from 54 tests.

About plugin

  • Plugin page: data-access-levels
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Mar 20, 2014
  • Latest release: Jan 22, 2015
  • Number of updates: 7
  • Update frequency: every 44.1 days
  • Top authors: lienann (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,090 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼7.65ms] Passed 4 tests

Server-side resources used by Data access levels
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1236.35 ▼5.44
Dashboard /wp-admin3.42 ▲0.1147.12 ▼1.56
Posts /wp-admin/edit.php3.53 ▲0.1748.14 ▼0.70
Add New Post /wp-admin/post-new.php6.00 ▲0.1184.87 ▼20.28
Media Library /wp-admin/upload.php3.34 ▲0.1134.64 ▼3.31

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
dal_plugin_version
widget_theysaidso_widget
widget_recent-comments
dal_post_types
theysaidso_admin_options
dal_settings
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Data access levels: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.65 ▼0.661.69 ▼0.1838.95 ▼5.94
Dashboard /wp-admin2,210 ▲185.79 ▲0.8298.63 ▼11.3540.75 ▼3.13
Posts /wp-admin/edit.php2,102 ▲132.01 ▼0.0539.76 ▼1.0436.23 ▼2.31
Add New Post /wp-admin/post-new.php6,802 ▲5,26019.35 ▲1.16901.77 ▲269.6365.74 ▲1.87
Media Library /wp-admin/upload.php1,392 ▲44.22 ▼0.0591.69 ▼11.7639.74 ▼3.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

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
Almost there! Just fix the following items
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/data-access-levels/lib/userfileds.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/data-access-levels/lib/dal_settings.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/data-access-levels/dal.php:57
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/data-access-levels/lib/restrictions.php on line 353
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/data-access-levels/lib/restrictions.php on line 353
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/data-access-levels/lib/restrictions.php on line 353
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/data-access-levels/lib/postfileds.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Plugin settings page), #2 (Access level column from the User panel (users.php)), #3 ("Access level" field on edit page)
The official readme.txt might help

data-access-levels/dal.php 85% from 13 tests

Analyzing the main PHP file in "Data access levels" version 1.1.1
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("data-access-levels.php" instead of "dal.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 161 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
There were no executable files found in this plugin694 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP7306270612
PO File1232964
JavaScript18018

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
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%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png47.20KB18.45KB▼ 60.92%
screenshot-2.png19.97KB8.38KB▼ 58.05%
screenshot-3.png4.46KB2.32KB▼ 48.14%