68% press-permit-core

Code Review | PublishPress Permissions: Control User Access for Posts, Pages, Categories, Tags

WordPress plugin PublishPress Permissions: Control User Access for Posts, Pages, Categories, Tags scored68%from 54 tests.

About plugin

  • Plugin page: press-permit-core
  • Plugin version: 3.11.5
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Sep 19, 2013
  • Latest release: Nov 2, 2023
  • Number of updates: 492
  • Update frequency: every 7.5 days
  • Top authors: kevinB (93.29%)stevejburge (3.66%)publishpress (3.46%)

Code review

54 tests

User reviews

54 reviews

Install metrics

10,000+ active /510,415 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲2.50MB] [CPU: ▲21.88ms] Passed 4 tests

This is a short check of server-side resources used by PublishPress Permissions: Control User Access for Posts, Pages, Categories, Tags
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.96 ▲2.5052.77 ▲17.64
Dashboard /wp-admin5.78 ▲2.4864.49 ▲15.27
Posts /wp-admin/edit.php5.96 ▲2.6072.57 ▲26.00
Add New Post /wp-admin/post-new.php9.30 ▲3.41149.17 ▲58.08
Media Library /wp-admin/upload.php5.68 ▲2.4460.46 ▲28.60

Server storage [IO: ▲4.70MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 367 new files
Database: 8 new tables, 17 new options
New tables
wp_ppi_errors
wp_ppc_exceptions
wp_pp_group_members
wp_ppc_roles
wp_ppi_imported
wp_pp_groups
wp_ppi_runs
wp_ppc_exception_items
New WordPress options
ppi_version
recovery_mode_email_last_sent
presspermit_version
can_compress_scripts
presspermit_buffer_metagroup_id_a140247aedb3dbd6ba99fac153249d40
theysaidso_admin_options
db_upgraded
ppperm_version_history
presspermit_wp_role_sync
presspermit_deactivated_modules
...

Browser metrics Passed 4 tests

Checking browser requirements for PublishPress Permissions: Control User Access for Posts, Pages, Categories, Tags
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8814.27 ▼0.081.76 ▼0.0330.78 ▼15.58
Dashboard /wp-admin2,247 ▲705.70 ▲0.0693.09 ▲0.1043.89 ▲0.94
Posts /wp-admin/edit.php2,155 ▲522.20 ▲0.2140.46 ▲5.6038.00 ▲0.09
Add New Post /wp-admin/post-new.php8,371 ▲6,84326.21 ▲3.181,051.09 ▲379.2447.91 ▼7.28
Media Library /wp-admin/upload.php1,450 ▲504.34 ▲0.1997.14 ▲0.1645.22 ▲0.86

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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 does not fully uninstall, leaving 8 tables in the database
    • wp_ppc_roles
    • wp_ppc_exception_items
    • wp_ppi_runs
    • wp_ppi_errors
    • wp_pp_group_members
    • wp_ppi_imported
    • wp_pp_groups
    • wp_ppc_exceptions
  • Zombie WordPress options were found after uninstall: 17 options
    • widget_theysaidso_widget
    • ppperm_added_role_caps_10beta
    • presspermit_activation
    • presspermit_wp_role_sync
    • db_upgraded
    • presspermit_buffer_metagroup_id_a140247aedb3dbd6ba99fac153249d40
    • presspermit_version
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/press-permit-core/lib/vendor/publishpress/wordpress-version-notices/templates/top-notice/notice.php
    • > /wp-content/plugins/press-permit-core/lib/vendor/publishpress/wordpress-version-notices/templates/menu-link/menu-link-script.php
  • 67× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'PublishPress\\WordpressVersionNotices\\Template\\TemplateLoaderInterface' not found in wp-content/plugins/press-permit-core/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateLoader.php:28
    • > PHP Fatal error
      require_once(): Failed opening required 'PRESSPERMIT_COLLAB_CLASSPATH/UI/RoleUsageQuery.php' (include_path='.:/usr/share/php') in wp-content/plugins/press-permit-core/modules/presspermit-collaboration/classes/Permissions/Collab/UI/RoleUsageListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_User' not found in wp-content/plugins/press-permit-core/classes/PublishPress/PermissionsUser.php:12
    • > PHP Warning
      Class 'PublishPress\\WordpressVersionNotices\\Module\\AdInterface' not found in wp-content/plugins/press-permit-core/lib/vendor/publishpress/wordpress-version-notices/src/deprecated.php on line 15
    • > PHP Fatal error
      require_once(): Failed opening required 'PRESSPERMIT_CLASSPATH/PostFilters.php' (include_path='.:/usr/share/php') in wp-content/plugins/press-permit-core/classes/PublishPress/Permissions/CapabilityFilters.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'PublishPress\\Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/press-permit-core/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php:39
    • > PHP Warning
      require_once(PRESSPERMIT_COLLAB_CLASSPATH/UI/RoleUsageQuery.php): failed to open stream: No such file or directory in wp-content/plugins/press-permit-core/modules/presspermit-collaboration/classes/Permissions/Collab/UI/RoleUsageListTable.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'PRESSPERMIT_CLASSPATH/UI/Dashboard/ItemEdit.php' (include_path='.:/usr/share/php') in wp-content/plugins/press-permit-core/classes/PublishPress/Permissions/UI/Dashboard/TermEdit.php on line 5
    • > PHP Warning
      require_once(PRESSPERMIT_CLASSPATH/UI/AgentPermissionsUI.php): failed to open stream: No such file or directory in wp-content/plugins/press-permit-core/classes/PublishPress/Permissions/UI/Dashboard/Profile.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/press-permit-core/classes/PublishPress/Permissions/UI/ItemsMetabox.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

press-permit-core/press-permit-core.php Passed 13 tests

The entry point to "PublishPress Permissions: Control User Access for Posts, Pages, Categories, Tags" version 3.11.5 is a PHP file that has certain tags in its header comment area
138 characters long description:
Advanced yet accessible content permissions. Give users or groups type-specific roles. Enable or block access for specific posts or terms.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin53,296 lines of code in 322 files:
LanguageFilesBlank linesComment linesLines of code
PHP2658,8103,87635,576
PO File106,90613,52412,628
CSS153501172,053
JavaScript24340811,592
LESS5272811,015
JSON200395
XML10037

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 156)
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity37.01
▷ Minimum class complexity1.00
▷ Maximum class complexity287.00
Average method complexity7.18
▷ Minimum method complexity1.00
▷ Maximum method complexity156.00
Code structure
Namespaces34
Interfaces6
Traits0
Classes222
▷ Abstract classes10.45%
▷ Concrete classes22199.55%
▷ Final classes20.90%
Methods1,327
▷ Static methods33725.40%
▷ Public methods1,16888.02%
▷ Protected methods70.53%
▷ Private methods15211.45%
Functions130
▷ Named functions8162.31%
▷ Anonymous functions4937.69%
Constants46
▷ Global constants4086.96%
▷ Class constants613.04%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
common/img/play.png2.08KB1.10KB▼ 46.87%
common/img/publishpress-logo.png8.69KB8.91KB0.00%
common/img/publishpress-logo-icon.png13.05KB4.10KB▼ 68.61%
common/img/pp-logo.png17.20KB7.60KB▼ 55.81%
common/img/comment-grey-bubble.png0.11KB0.11KB0.00%