84% conditional-login-shortcodes

Code Review | Conditional Login Shortcodes

WordPress plugin Conditional Login Shortcodes scored84%from 54 tests.

About plugin

  • Plugin page: conditional-login...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Aug 2, 2014
  • Latest release: Aug 2, 2014
  • Number of updates: 3
  • Update frequency: every 2.7 days
  • Top authors: enishant (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,152 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.01MB] [CPU: ▼7.70ms] Passed 4 tests

Analyzing server-side resources used by Conditional Login Shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.61 ▲1.89
Dashboard /wp-admin3.32 ▼0.0244.05 ▼18.55
Posts /wp-admin/edit.php3.37 ▲0.0245.89 ▲2.21
Add New Post /wp-admin/post-new.php5.90 ▲0.0278.53 ▼15.53
Media Library /wp-admin/upload.php3.24 ▲0.0233.05 ▲1.40

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Conditional Login Shortcodes
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.29 ▼1.091.72 ▲0.0446.27 ▲3.09
Dashboard /wp-admin2,209 ▲205.86 ▲0.8793.67 ▼29.9339.04 ▼4.33
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0035.42 ▲0.4836.06 ▲3.19
Add New Post /wp-admin/post-new.php1,514 ▼2017.64 ▼3.51614.11 ▼56.2552.91 ▼3.88
Media Library /wp-admin/upload.php1,388 ▲34.28 ▼0.0197.37 ▼4.9741.72 ▼2.65

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
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/conditional-login-shortcodes/index.php:101

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 93% from 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
6 plugin tags: shortcode, protect content, conditional, conditional login shortcodes, shortcodes...

conditional-login-shortcodes/index.php 85% from 13 tests

The main PHP script in "Conditional Login Shortcodes" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("conditional-login-shortcodes.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 211 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin84 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP191184

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected