84% logic-shortcodes

Code Review | Logic Shortcodes

WordPress plugin Logic Shortcodes scored84%from 54 tests.

About plugin

  • Plugin page: logic-shortcodes
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 19, 2016
  • Latest release: Apr 28, 2016
  • Number of updates: 4
  • Update frequency: every 2.3 days
  • Top authors: samueldiethelm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /939 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.29ms] Passed 4 tests

Server-side resources used by Logic Shortcodes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.43 ▼0.75
Dashboard /wp-admin3.31 ▲0.0149.96 ▼7.43
Posts /wp-admin/edit.php3.36 ▲0.0147.13 ▼6.31
Add New Post /wp-admin/post-new.php5.89 ▲0.0199.30 ▼3.52
Media Library /wp-admin/upload.php3.23 ▲0.0136.14 ▼3.90

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Logic Shortcodes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.58 ▲0.231.76 ▼0.0343.44 ▼5.17
Dashboard /wp-admin2,195 ▲215.62 ▼0.0586.39 ▼5.4439.92 ▼6.60
Posts /wp-admin/edit.php2,097 ▼32.00 ▲0.0035.24 ▼0.9534.38 ▼2.10
Add New Post /wp-admin/post-new.php1,526 ▼923.37 ▲5.03622.23 ▼70.5652.73 ▼19.99
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0998.09 ▼12.7442.75 ▼4.74

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/logic-shortcodes/logic-shortcodes.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === logic-shortcodes === )
You can take inspiration from this readme.txt

logic-shortcodes/logic-shortcodes.php Passed 13 tests

The primary PHP file in "Logic Shortcodes" version 1.0 is used by WordPress to initiate all plugin functionality
74 characters long description:
Use shortcodes for conditional logic based on post meta or taxonomy terms.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin39 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15939

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.85
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin