84% cc-img-shortcode

Code Review | CC-IMG-Shortcode

WordPress plugin CC-IMG-Shortcode scored84%from 54 tests.

About plugin

  • Plugin page: cc-img-shortcode
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8.2-5.9.2
  • WordPress version: 6.3.1
  • First release: Oct 20, 2017
  • Latest release: Mar 16, 2022
  • Number of updates: 3
  • Update frequency: every 536.4 days
  • Top authors: ClearcodeHQ (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /786 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.09MB] [CPU: ▼3.51ms] Passed 4 tests

This is a short check of server-side resources used by CC-IMG-Shortcode
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1050.00 ▲3.76
Dashboard /wp-admin3.39 ▲0.0847.98 ▼0.14
Posts /wp-admin/edit.php3.50 ▲0.1552.52 ▼4.14
Add New Post /wp-admin/post-new.php5.97 ▲0.0896.15 ▼11.41
Media Library /wp-admin/upload.php3.31 ▲0.0840.22 ▲1.64

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by CC-IMG-Shortcode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.35 ▲0.002.06 ▲0.2948.17 ▲6.55
Dashboard /wp-admin2,192 ▲215.56 ▲0.0287.61 ▼3.8939.06 ▼7.42
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0739.13 ▼4.2435.80 ▼0.74
Add New Post /wp-admin/post-new.php1,526 ▼523.02 ▼0.31659.68 ▲48.8252.24 ▲2.53
Media Library /wp-admin/upload.php1,403 ▲34.19 ▼0.07102.80 ▼4.8847.61 ▲2.04

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Clearcode\\IMG_Shortcode\\Singleton' not found in wp-content/plugins/cc-img-shortcode/includes/class-plugin.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Clearcode\\IMG_Shortcode\\Plugin' not found in wp-content/plugins/cc-img-shortcode/includes/class-img-shortcode.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% 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:
  • Screenshots: Screenshot #1 (**CC-IMG-Shortcode Example**) image required
You can look at the official readme.txt

cc-img-shortcode/plugin.php 92% from 13 tests

Analyzing the main PHP file in "CC-IMG-Shortcode" version 1.1.0
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cc-img-shortcode.php" instead of "plugin.php")

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
No dangerous file extensions were detected319 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP710690295
JSON10024

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity18.67
▷ Minimum class complexity2.00
▷ Maximum class complexity30.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods24
▷ Static methods1041.67%
▷ Public methods1875.00%
▷ Protected methods625.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
1 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png68.14KB23.26KB▼ 65.87%