84% custom-content-shortcode

Code Review | Custom Content Shortcode

WordPress plugin Custom Content Shortcode scored 84% from 54 tests.

About plugin

  • Plugin page: custom-content-sh...
  • Plugin version: 4.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.9.2
  • First release: Sep 11, 2013
  • Latest release: Feb 1, 2022
  • Number of updates: 591
  • Update frequency: every 5.2 days
  • Top authors: miyarakira (100%)

Code review

54 tests

User reviews

162 reviews

Install metrics

10,000+ active / 330,492 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼314.11ms] Passed 4 tests

A check of server-side resources used by Custom Content Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.1762.15 ▲7.06
Dashboard /wp-admin3.53 ▲0.1336.89 ▲0.12
Posts /wp-admin/edit.php3.76 ▲0.1243.72 ▼0.90
Add New Post /wp-admin/post-new.php7.00 ▲0.03114.02 ▼1,256.91
Media Library /wp-admin/upload.php3.42 ▲0.1229.68 ▲1.26
Content /wp-admin/index.php?page=content_overview3.4958.50
Gallery Fields /wp-admin/options-general.php?page=ccs_gallery_field_settings3.3924.34
Custom Content /wp-admin/options-general.php?page=ccs_reference3.9033.07

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 78 new files
Database: no new tables, 2 new options
New WordPress options
ccs_content_settings
ccs_admin_notice_20220123_dismissed

Browser metrics Passed 4 tests

Checking browser requirements for Custom Content Shortcode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲6215.98 ▲0.237.02 ▲1.332.31 ▼0.10
Dashboard /wp-admin2,922 ▲616.15 ▼0.07115.13 ▼15.49232.07 ▲73.17
Posts /wp-admin/edit.php2,719 ▲473.24 ▲0.0064.62 ▲0.45144.95 ▲4.26
Add New Post /wp-admin/post-new.php1,732 ▲7020.80 ▲2.66539.63 ▲66.26261.48 ▲45.17
Media Library /wp-admin/upload.php1,725 ▲305.49 ▼0.02145.93 ▲6.57204.76 ▼42.75
Content /wp-admin/index.php?page=content_overview3,0402.6657.65216.92
Gallery Fields /wp-admin/options-general.php?page=ccs_gallery_field_settings1,0522.4353.45113.62
Custom Content /wp-admin/options-general.php?page=ccs_reference1,3802.83105.67170.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 1 option in the database
    • ccs_admin_notice_20220123_dismissed

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following items
  • 33× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_ccs_shortcode() in wp-content/plugins/custom-content-shortcode/includes/optional/load.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_ccs_shortcode() in wp-content/plugins/custom-content-shortcode/includes/modules/url.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/custom-content-shortcode/custom-content-shortcode.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_ccs_shortcode() in wp-content/plugins/custom-content-shortcode/includes/modules/foreach.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_ccs_shortcode() in wp-content/plugins/custom-content-shortcode/includes/modules/format.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_ccs_shortcode() in wp-content/plugins/custom-content-shortcode/includes/modules/pass.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-content-shortcode/includes/docs/docs.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_ccs_shortcode() in wp-content/plugins/custom-content-shortcode/includes/modules/attached.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_ccs_shortcode() in wp-content/plugins/custom-content-shortcode/includes/modules/if.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/custom-content-shortcode/includes/optional/mobile.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: sidebar, query, loop, taxonomy, post type...

custom-content-shortcode/custom-content-shortcode.php Passed 13 tests

The main PHP file in "Custom Content Shortcode" ver. 4.0.2 adds more information about the plugin and also serves as the entry point for this plugin
116 characters long description:
Display posts, pages, custom post types, custom fields, files, images, comments, attachments, menus, or widget areas

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin17,280 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
PHP375,3123,61713,082
Markdown301,77702,728
JavaScript3190111798
CSS612594672

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 291)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity86.51
▷ Minimum class complexity2.00
▷ Maximum class complexity521.00
Average method complexity7.54
▷ Minimum method complexity1.00
▷ Maximum method complexity291.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes00.00%
Methods426
▷ Static methods18944.37%
▷ Public methods38089.20%
▷ Protected methods4610.80%
▷ Private methods00.00%
Functions35
▷ Named functions3188.57%
▷ Anonymous functions411.43%
Constants13
▷ Global constants323.08%
▷ Class constants1076.92%
▷ Public constants10100.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
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
includes/docs/logo.png4.28KB0.89KB▼ 79.24%