83% content-permissions-for-pages-posts

Code Review | Content Permissions for Pages & Posts

WordPress plugin Content Permissions for Pages & Posts scored83%from 54 tests.

About plugin

  • Plugin page: content-permissio...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8
  • WordPress version: 6.3.1
  • First release: Nov 16, 2017
  • Latest release: Nov 17, 2017
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: paramsheoran (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /825 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.00MB] [CPU: ▼4.23ms] Passed 4 tests

An overview of server-side resources used by Content Permissions for Pages & Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.49 ▲5.91
Dashboard /wp-admin3.31 ▲0.0046.88 ▼0.32
Posts /wp-admin/edit.php3.36 ▲0.0047.63 ▼3.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.24 ▼8.07
Media Library /wp-admin/upload.php3.23 ▲0.0030.80 ▼5.02

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Content Permissions for Pages & Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.36 ▼0.994.29 ▲2.7143.27 ▲4.61
Dashboard /wp-admin2,209 ▲235.92 ▲0.9898.68 ▼18.6139.22 ▼4.70
Posts /wp-admin/edit.php2,092 ▲242.00 ▼0.0139.33 ▼0.8134.82 ▼0.56
Add New Post /wp-admin/post-new.php1,540 ▲1023.47 ▲5.36589.11 ▼15.9647.67 ▼13.21
Media Library /wp-admin/upload.php1,388 ▼34.16 ▼0.0393.27 ▼10.1143.38 ▼3.03

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/content-permissions-for-pages-posts/index.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: restrict content, private content, content restriction, restrict pages, content permissions...

content-permissions-for-pages-posts/index.php 77% from 13 tests

The main PHP file in "Content Permissions for Pages & Posts" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("content-permissions-for-pages-posts.php" instead of "index.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 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
No dangerous file extensions were detected13 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1131613

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code1.00
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%
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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin