72% post-access-controller

Code Review | Post Access Controller

WordPress plugin Post Access Controller scored72%from 54 tests.

About plugin

  • Plugin page: post-access-contr...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 6.3.1
  • First release: Mar 31, 2014
  • Latest release: Jun 15, 2016
  • Number of updates: 27
  • Update frequency: every 29.9 days
  • Top authors: arsdehnel (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20+ active /5,272 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.24MB] [CPU: ▼3.55ms] Passed 4 tests

This is a short check of server-side resources used by Post Access Controller
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2342.38 ▲3.67
Dashboard /wp-admin3.60 ▲0.2647.19 ▼9.31
Posts /wp-admin/edit.php3.65 ▲0.3048.23 ▲1.08
Add New Post /wp-admin/post-new.php6.14 ▲0.2580.12 ▼9.65
Media Library /wp-admin/upload.php3.46 ▲0.2337.64 ▲5.26
Access Controls /wp-admin/options-general.php?page=post-access-controller--options3.4334.81
Group Maintenance /wp-admin/admin.php?page=post-access-controller--group-edit3.4032.23
Group Master Processing /wp-admin/admin.php?page=post-access-controller--group-save3.4024.56
Group Master Processing /wp-admin/admin.php?page=post-access-controller--group-archive3.4029.98
User Groups /wp-admin/users.php?page=post-access-controller--groups-listing3.4828.80

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Post Access Controller
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5114.35 ▼0.221.75 ▲0.0846.43 ▲11.27
Dashboard /wp-admin2,197 ▲205.54 ▼0.0682.00 ▼5.8334.47 ▼13.00
Posts /wp-admin/edit.php2,108 ▲291.95 ▼0.0535.56 ▲2.2234.04 ▼1.08
Add New Post /wp-admin/post-new.php1,536 ▲1023.77 ▲0.08672.70 ▲36.2551.97 ▼4.64
Media Library /wp-admin/upload.php1,408 ▲144.13 ▼0.09108.13 ▲8.6746.42 ▲1.22
Access Controls /wp-admin/options-general.php?page=post-access-controller--options9402.0027.9727.97
Group Maintenance /wp-admin/admin.php?page=post-access-controller--group-edit8811.9921.8424.54
Group Master Processing /wp-admin/admin.php?page=post-access-controller--group-save7692.0323.8021.33
Group Master Processing /wp-admin/admin.php?page=post-access-controller--group-archive7732.0022.3421.38
User Groups /wp-admin/users.php?page=post-access-controller--groups-listing9321.516.4024.25

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-edit
    • > Notice in wp-content/plugins/post-access-controller/classes/user-groups.php+178
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-edit
    • > Notice in wp-content/plugins/post-access-controller/classes/user-groups.php+178
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-save
    • > Notice in wp-content/plugins/post-access-controller/classes/user-groups.php+229
    Undefined index: post_title
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-save
    • > Notice in wp-content/plugins/post-access-controller/classes/user-groups.php+196
    Undefined index: post_status
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-save
    • > Notice in wp-content/plugins/post-access-controller/classes/user-groups.php+254
    Undefined index: post_content
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-save
    • > Warning in wp-content/plugins/post-access-controller/classes/user-groups.php+254
    array_values() expects parameter 1 to be array, null given
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-save
    • > Warning in wp-content/plugins/post-access-controller/classes/user-groups.php+254
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-save
    • > Notice in wp-content/plugins/post-access-controller/classes/user-groups.php+261
    Undefined index: public_ind
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-archive
    • > Notice in wp-content/plugins/post-access-controller/classes/db.php+20
    Undefined index: post_id
    • > GET request to /wp-admin/admin.php?page=post-access-controller--group-archive
    • > Notice in wp-content/plugins/post-access-controller/classes/db.php+25
    Undefined index: ID
    • > GET request to /wp-admin/users.php?page=post-access-controller--groups-listing
    • > Warning in wp-content/plugins/post-access-controller/classes/db.php+150
    count(): Parameter must be an array or an object that implements Countable

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/post-access-controller/views/user-profile.php
  • 36× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/post-access-controller/views/group_post_type/save.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-access-controller/classes/ui.php on line 178
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/post-access-controller/views/post_meta/options.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/post-access-controller/views/group_post_type/save.php on line 7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/post-access-controller/classes/list-table.php on line 4
    • > PHP Notice
      Undefined variable: results in wp-content/plugins/post-access-controller/views/group_post_type/save.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-access-controller/classes/ui.php on line 178
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/post-access-controller/classes/ui.php on line 178
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/post-access-controller/classes/ui.php on line 178
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/post-access-controller/views/post_meta/options.php on line 6

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

readme.txt 94% 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:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === post-access-controller === )
Please take inspiration from this readme.txt

post-access-controller/post-access-controller.php Passed 13 tests

The principal PHP file in "Post Access Controller" v. 1.1.1 is loaded by WordPress automatically on each request
108 characters long description:
Allow control of access to individual posts by setting individual users, user groups or roles to have access

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
There were no executable files found in this plugin1,565 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP185633731,324
CSS2913150
JavaScript129091

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity13.73
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods92
▷ Static methods00.00%
▷ Public methods8390.22%
▷ Protected methods00.00%
▷ Private methods99.78%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.55MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-5.png164.29KB52.47KB▼ 68.06%
assets/screenshot-1.png97.37KB29.39KB▼ 69.82%
assets/screenshot-4.png96.71KB29.83KB▼ 69.15%
assets/screenshot-2.png124.61KB39.08KB▼ 68.64%
assets/screenshot-3.png79.43KB23.82KB▼ 70.01%