78% demo-shortcodes

Code Review | Demo shortcode

WordPress plugin Demo shortcode scored 78% from 54 tests.

About plugin

  • Plugin page: demo-shortcodes
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 15, 2017
  • Latest release: Apr 15, 2017
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: kantoniak (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 590 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.97ms] Passed 4 tests

An overview of server-side resources used by Demo shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.69 ▼6.73
Dashboard /wp-admin3.31 ▲0.0145.05 ▼4.76
Posts /wp-admin/edit.php3.36 ▲0.0049.98 ▲0.62
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.26 ▼17.01
Media Library /wp-admin/upload.php3.23 ▲0.0034.97 ▲1.04

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Demo shortcode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.17 ▼1.194.56 ▲2.5639.71 ▼3.20
Dashboard /wp-admin2,210 ▲224.90 ▼0.00108.35 ▲2.5436.61 ▼4.97
Posts /wp-admin/edit.php2,093 ▲12.05 ▼0.0140.35 ▲2.0133.94 ▼0.74
Add New Post /wp-admin/post-new.php1,527 ▼1518.51 ▲0.46628.35 ▼9.5353.96 ▲7.92
Media Library /wp-admin/upload.php1,392 ▲74.28 ▲0.0994.89 ▼6.6242.18 ▼1.65

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/demo-shortcodes/template-shortcode-demo.php
    • > /wp-content/plugins/demo-shortcodes/template-popup-add.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function kantoniak\\add_shortcode() in wp-content/plugins/demo-shortcodes/kantoniak-demos.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: demo shortcode

demo-shortcodes/kantoniak-demos.php 92% from 13 tests

The main PHP script in "Demo shortcode" version 0.0.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("demo-shortcodes.php" instead of "kantoniak-demos.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin149 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP314989
JavaScript15036
CSS21024

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon-16.png0.56KB0.48KB▼ 14.21%