90% protect-pages-and-categories-with-login

Code Review | Protect pages and categories with login

WordPress plugin Protect pages and categories with login scored90%from 54 tests.

About plugin

  • Plugin page: protect-pages-and...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-5.1
  • WordPress version: 6.3.1
  • First release: Oct 30, 2017
  • Latest release: Jul 3, 2019
  • Number of updates: 11
  • Update frequency: every 55.9 days
  • Top authors: mrrotella (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,512 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.99ms] Passed 4 tests

Server-side resources used by Protect pages and categories with login
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.57 ▼5.82
Dashboard /wp-admin3.34 ▲0.0446.14 ▼2.01
Posts /wp-admin/edit.php3.39 ▲0.0347.10 ▼4.51
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.73 ▼3.91
Media Library /wp-admin/upload.php3.26 ▲0.0335.05 ▼5.71

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Protect pages and categories with login
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼1.071.51 ▼0.5042.22 ▼2.43
Dashboard /wp-admin2,206 ▲324.84 ▼1.17106.23 ▲3.8442.74 ▲6.15
Posts /wp-admin/edit.php2,089 ▲142.02 ▼0.0139.51 ▲0.3634.66 ▲2.08
Add New Post /wp-admin/post-new.php1,533 ▲1923.15 ▲5.64592.73 ▼148.6951.77 ▼19.58
Media Library /wp-admin/upload.php1,385 ▼34.19 ▼0.0299.33 ▼15.6842.57 ▼6.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
3 plugin tags: protect page with login, protect category with login, login

protect-pages-and-categories-with-login/protect-pages-and-categories-with-login.php Passed 13 tests

The principal PHP file in "Protect pages and categories with login" v. 1.3 is loaded by WordPress automatically on each request
58 characters long description:
Protect pages and categories with login using a shortcode.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin183 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33045133
PO File1151550

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity5.80
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG files were detected