Benchmarks
Plugin footprint 64% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully
Server metrics [RAM: ▲5.57MB] [CPU: ▲23.18ms] 50% from 4 tests
Analyzing server-side resources used by Restrict Posts based on Conditions - Conditional Post Restrictions
The following require your attention
- CPU: Total CPU usage should be kept under 500.00ms (currently 1,645.55ms on /wp-admin/options-general.php?page=vpr_settings)
- Extra RAM: Try to keep extra memory usage under 5MB (currently 5.57MB on /wp-admin/options-general.php?page=vpr_settings)
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 9.26 ▲5.79 | 73.43 ▲12.80 |
Dashboard /wp-admin | 9.28 ▲5.97 | 90.10 ▲33.98 |
Posts /wp-admin/edit.php | 9.28 ▲5.92 | 92.46 ▲37.31 |
Add New Post /wp-admin/post-new.php | 10.49 ▲4.60 | 132.50 ▲8.64 |
Media Library /wp-admin/upload.php | 9.28 ▲6.04 | 77.77 ▲37.40 |
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius | 9.28 | 88.68 |
Posts restrictions /wp-admin/options-general.php?page=vpr_settings | 9.28 | 1,645.55 |
Server storage [IO: ▲3.77MB] [DB: ▲0.00MB] Passed 3 tests
How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 284 new files
Database: no new tables, 10 new options
New WordPress options |
---|
wpcpr_welcome_redirect |
widget_recent-posts |
widget_theysaidso_widget |
theysaidso_admin_options |
db_upgraded |
fs_active_plugins |
fs_debug_mode |
widget_recent-comments |
fs_accounts |
can_compress_scripts |
Browser metrics Passed 4 tests
Restrict Posts based on Conditions - Conditional Post Restrictions: an overview of browser usage
Normal browser usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,810 ▲24 | 14.37 ▲0.13 | 1.71 ▼0.43 | 30.48 ▼16.01 |
Dashboard /wp-admin | 2,219 ▲42 | 5.61 ▼0.10 | 99.66 ▼12.40 | 46.77 ▼9.31 |
Posts /wp-admin/edit.php | 2,122 ▲19 | 2.06 ▲0.02 | 45.33 ▲2.24 | 41.74 ▼0.89 |
Add New Post /wp-admin/post-new.php | 1,827 ▲301 | 20.28 ▲2.75 | 688.79 ▼91.11 | 55.44 ▼7.73 |
Media Library /wp-admin/upload.php | 1,421 ▲24 | 4.15 ▼0.03 | 108.19 ▼5.67 | 49.26 ▲0.82 |
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius | 1,089 | 1.95 | 31.48 | 33.31 |
Posts restrictions /wp-admin/options-general.php?page=vpr_settings | 1,044 | 1.90 | 27.73 | 61.00 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests
🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
- Uninstall procedure had uncaught errors
- > Notice in wp-content/plugins/wp-conditional-post-restrictions/vendor/freemius/includes/class-freemius.php+8486
Undefined property: stdClass::$plugins
- This plugin did not uninstall successfully, leaving 10 options in the database
- wpcpr_welcome_redirect
- fs_debug_mode
- theysaidso_admin_options
- db_upgraded
- fs_active_plugins
- widget_theysaidso_widget
- widget_recent-posts
- can_compress_scripts
- fs_accounts
- 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
- 21× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
- > PHP Warning
Use of undefined constant WPCPR_DIST_DIR - assumed 'WPCPR_DIST_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-conditional-post-restrictions/inc/freemius-init.php on line 11
- > PHP Fatal error
require_once(): Failed opening required 'WPCPR_DIST_DIR/vendor/freemius/start.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-conditional-post-restrictions/inc/freemius-init.php on line 11
- > PHP Fatal error
Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-conditional-post-restrictions/modules/core/wpcr/conditions.php:9
- > PHP Fatal error
Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wp-conditional-post-restrictions/vendor/vg-plugin-sdk/views/page-template.php:5
- > PHP Fatal error
Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-conditional-post-restrictions/backend/settings-page.php:3
- > PHP Fatal error
Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-conditional-post-restrictions/backend/teasers.php:3
- > PHP Fatal error
Uncaught Error: Class 'Vegacorp_Condition' not found in wp-content/plugins/wp-conditional-post-restrictions/modules/core/inc/conditions/user/user-role.php:5
- > PHP Fatal error
Uncaught Error: Class 'Vegacorp_Condition' not found in wp-content/plugins/wp-conditional-post-restrictions/modules/core/inc/conditions/posts/is-the-post-author.php:5
- > PHP Fatal error
Uncaught Error: Class 'Vegacorp_Condition' not found in wp-content/plugins/wp-conditional-post-restrictions/modules/core/inc/conditions/posts/referer.php:5
- > PHP Fatal error
Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-conditional-post-restrictions/modules/core/views/frontend/custom-restricted-object-content.php:2
- > PHP Warning
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 Passed 29 tests
readme.txt Passed 16 tests
The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: registration form, access-control, restrict access, restrict posts, restrict pages
wp-conditional-post-restrictions/wp-conditional-post-restrictions.php Passed 13 tests
The main PHP script in "Restrict Posts based on Conditions - Conditional Post Restrictions" version 1.2.2 is automatically included on every request by WordPress
45 characters long description:
Restricts posts based on different conditions
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 plugin46,496 lines of code in 239 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 152 | 9,072 | 17,848 | 36,185 |
JavaScript | 66 | 2,653 | 729 | 9,788 |
CSS | 19 | 69 | 0 | 512 |
XML | 1 | 0 | 0 | 10 |
SVG | 1 | 0 | 0 | 1 |
PHP code 50% from 2 tests
A short review of cyclomatic complexity and code structure
Please tend to the following items
- Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.60 |
Average class complexity | 65.66 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 3,073.00 |
Average method complexity | 4.29 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 94.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 8 | |
Classes | 66 | |
▷ Abstract classes | 3 | 4.55% |
▷ Concrete classes | 63 | 95.45% |
▷ Final classes | 0 | 0.00% |
Methods | 1,485 | |
▷ Static methods | 201 | 13.54% |
▷ Public methods | 1,090 | 73.40% |
▷ Protected methods | 20 | 1.35% |
▷ Private methods | 375 | 25.25% |
Functions | 112 | |
▷ Named functions | 112 | 100.00% |
▷ Anonymous functions | 0 | 0.00% |
Constants | 152 | |
▷ Global constants | 105 | 69.08% |
▷ Class constants | 47 | 30.92% |
▷ Public constants | 47 | 100.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 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
vendor/freemius/assets/img/theme-icon.png | 10.97KB | 5.78KB | ▼ 47.37% |
vendor/freemius/assets/img/plugin-icon.png | 9.16KB | 5.26KB | ▼ 42.58% |