83% cothemes-shortcode

Code Review | CooThemes Shortcodes

WordPress plugin CooThemes Shortcodes scored83%from 54 tests.

About plugin

  • Plugin page: cothemes-shortcode
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-4.9.7
  • WordPress version: 6.3.1
  • First release: Oct 11, 2016
  • Latest release: Jul 25, 2018
  • Number of updates: 42
  • Update frequency: every 15.5 days
  • Top authors: coothemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /6,057 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.25MB] [CPU: ▼6.86ms] Passed 4 tests

A check of server-side resources used by CooThemes Shortcodes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2538.44 ▼4.99
Dashboard /wp-admin3.55 ▲0.2445.83 ▼5.49
Posts /wp-admin/edit.php3.66 ▲0.3053.46 ▲9.08
Add New Post /wp-admin/post-new.php6.15 ▲0.2681.49 ▼18.04
Media Library /wp-admin/upload.php3.47 ▲0.2437.43 ▲1.10

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 48 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

CooThemes Shortcodes: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲18414.31 ▼0.069.00 ▲7.0952.45 ▲0.95
Dashboard /wp-admin2,233 ▲425.07 ▼0.97110.76 ▲6.8139.45 ▼9.08
Posts /wp-admin/edit.php2,129 ▲402.42 ▲0.4245.29 ▲4.7436.41 ▲0.92
Add New Post /wp-admin/post-new.php1,541 ▲423.35 ▲4.98624.18 ▼10.5536.25 ▼33.18
Media Library /wp-admin/upload.php1,429 ▲414.61 ▲0.38100.57 ▼4.5543.52 ▲0.57

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cothemes-shortcode/inc/shortcode/tab.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cothemes-shortcode/inc/popup.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cothemes-shortcode/inc/shortcode/box.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cothemes-shortcode/inc/shortcode/button.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cothemes-shortcode/inc/shortcode/tooltip.php:1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/cothemes-shortcode/inc/popup.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cothemes-shortcode/inc/shortcode/toggle.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 31 tag instead of maximum 10
Please take inspiration from this readme.txt

cothemes-shortcode/coothemes.php 69% from 13 tests

The principal PHP file in "CooThemes Shortcodes" v. 1.0.4 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 366 characters long)
  • Domain Path: The domain path folder was not found ("/languages")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("cothemes-shortcode.php" instead of "coothemes.php")

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 plugin15,604 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
CSS911010210,116
JavaScript78363132,675
PHP103231261,523
SVG200973
PO File1138138317

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
10 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/images/shortcode.png2.88KB0.22KB▼ 92.41%
inc/images/noway.png4.29KB1.46KB▼ 65.99%
inc/images/return.png1.12KB0.37KB▼ 66.58%
inc/images/clipboard.png5.10KB1.85KB▼ 63.77%
inc/images/shortcode1.png2.88KB0.22KB▼ 92.40%