84% nutsforpress-restricted-contents

Code Review | NutsForPress Restricted Contents

WordPress plugin NutsForPress Restricted Contents scored84%from 54 tests.

About plugin

  • Plugin page: nutsforpress-rest...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Jun 23, 2021
  • Latest release: Aug 4, 2023
  • Number of updates: 15
  • Update frequency: every 51.6 days
  • Top authors: Christian Gatti (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,025 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼3.52ms] Passed 4 tests

Server-side resources used by NutsForPress Restricted Contents
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2044.46 ▼2.04
Dashboard /wp-admin3.50 ▲0.1958.84 ▲0.73
Posts /wp-admin/edit.php3.62 ▲0.2654.93 ▲4.80
Add New Post /wp-admin/post-new.php6.11 ▲0.2191.28 ▼17.55
Media Library /wp-admin/upload.php3.43 ▲0.2043.58 ▲7.19
NutsForPress /wp-admin/admin.php?page=nfproot-settings3.4038.10
Restricted Contents /wp-admin/admin.php?page=nfprct-settings3.4744.47

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

NutsForPress Restricted Contents: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6414.67 ▲0.021.72 ▲0.0643.40 ▲5.11
Dashboard /wp-admin2,234 ▲605.70 ▲0.0590.27 ▼1.0940.20 ▼3.79
Posts /wp-admin/edit.php2,136 ▲362.06 ▲0.0337.14 ▼2.0534.76 ▼1.56
Add New Post /wp-admin/post-new.php6,303 ▲4,77725.96 ▲8.40891.80 ▲240.6157.47 ▲3.74
Media Library /wp-admin/upload.php1,436 ▲394.27 ▲0.0299.42 ▼2.4942.95 ▲0.90
NutsForPress /wp-admin/admin.php?page=nfproot-settings8392.0822.7427.30
Restricted Contents /wp-admin/admin.php?page=nfprct-settings9322.0626.9330.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 17× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/nutsforpress-restricted-contents/admin/nfprct-settings.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/admin/includes/nfprct-restricted-contents-fields.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/admin/includes/nfprct-filter-rewrite-rules.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/root/nfproot-saved-settings.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/root/nfproot-settings.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/root/nfproot-save-settings.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/nuts-for-press-restricted-contents.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/admin/includes/nfprct-add-lock-to-post-title.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/admin/includes/nfprct-admin-common-functions.php
    • > /wp-content/plugins/nutsforpress-restricted-contents/root/nfproot-styles-and-scripts.php

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Requires php: Invalid version format
The official readme.txt is a good inspiration

nutsforpress-restricted-contents/nuts-for-press-restricted-contents.php 92% from 13 tests

"NutsForPress Restricted Contents" version 1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("nutsforpress-restricted-contents.php" instead of "nuts-for-press-restricted-contents.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,931 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP171,2912691,683
JavaScript29750136
CSS1291112

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
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%
Functions39
▷ Named functions3897.44%
▷ Anonymous functions12.56%
Constants5
▷ Global constants5100.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
PNG images were not found in this plugin