78% if-as-shortcode

Code Review | IF AS Shortcode

WordPress plugin IF AS Shortcode scored78%from 54 tests.

About plugin

  • Plugin page: if-as-shortcode
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 16, 2016
  • Latest release: Jun 1, 2019
  • Number of updates: 7
  • Update frequency: every 141.1 days
  • Top authors: okfie (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /987 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
Install script ran successfully

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

Server-side resources used by IF AS Shortcode
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.25 ▼2.04
Dashboard /wp-admin3.34 ▲0.0345.64 ▼7.74
Posts /wp-admin/edit.php3.45 ▲0.0948.36 ▲3.12
Add New Post /wp-admin/post-new.php5.92 ▲0.0396.25 ▼3.04
Media Library /wp-admin/upload.php3.26 ▲0.0339.30 ▲5.89

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_restricted_content_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for IF AS Shortcode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8013.21 ▼1.172.09 ▲0.1742.14 ▼5.57
Dashboard /wp-admin2,211 ▲235.85 ▲0.97108.16 ▼7.0138.95 ▼8.50
Posts /wp-admin/edit.php2,091 ▲22.02 ▲0.0339.90 ▲2.4734.23 ▲0.66
Add New Post /wp-admin/post-new.php1,538 ▲1823.55 ▲0.42589.36 ▼93.3558.00 ▲9.49
Media Library /wp-admin/upload.php1,393 ▲24.17 ▼0.0798.65 ▼10.2242.27 ▼5.48

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_restricted_content_widget
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/if-as-shortcode/include/js/index.php
    • > /wp-content/plugins/if-as-shortcode/include/index.php
    • > /wp-content/plugins/if-as-shortcode/lang/index.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/if-as-shortcode/if_as_shortcode.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/if-as-shortcode/include/restricted-content.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Requires at least: Version format is invalid
The official readme.txt is a good inspiration

if-as-shortcode/if_as_shortcode.php 92% from 13 tests

The main file in "IF AS Shortcode" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("if-as-shortcode.php" instead of "if_as_shortcode.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
No dangerous file extensions were detected519 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4109127343
JavaScript3202192
PO File1313184

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity4.22
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
include/if.png0.63KB0.33KB▼ 47.38%