90% cpt-shortcode

Code Review | CPT Shortcode Generator

WordPress plugin CPT Shortcode Generator scored90%from 54 tests.

About plugin

  • Plugin page: cpt-shortcode
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9.1
  • WordPress version: 6.3.1
  • First release: Dec 29, 2017
  • Latest release: Jan 2, 2018
  • Number of updates: 8
  • Update frequency: every 0.5 days
  • Top authors: anurag.deshmukh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /725 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.02MB] [CPU: ▼7.14ms] Passed 4 tests

Server-side resources used by CPT Shortcode Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.85 ▼3.16
Dashboard /wp-admin3.33 ▲0.0351.66 ▼3.03
Posts /wp-admin/edit.php3.38 ▲0.0249.44 ▲0.32
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.35 ▼22.69
Media Library /wp-admin/upload.php3.26 ▲0.0237.53 ▲0.35

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

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

Browser metrics Passed 4 tests

CPT Shortcode Generator: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.72 ▲0.371.67 ▼0.1844.55 ▲2.15
Dashboard /wp-admin2,214 ▲345.64 ▲0.0385.05 ▼10.8339.30 ▼3.78
Posts /wp-admin/edit.php2,116 ▲162.02 ▲0.0334.29 ▼1.6436.04 ▲1.29
Add New Post /wp-admin/post-new.php1,540 ▲1423.33 ▲0.26678.84 ▼29.1546.40 ▼9.50
Media Library /wp-admin/upload.php1,413 ▲134.20 ▲0.0198.21 ▲1.0946.35 ▲2.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: cpt, post type, custom post types, custom, shortcode...

cpt-shortcode/cpt-shortcode.php Passed 13 tests

The main PHP file in "CPT Shortcode Generator" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
83 characters long description:
A plugin to generate shortcode to display Custom Post Type listing wherever needed.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected337 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP43335272
CSS21060
JavaScript13185

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.20MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-2.png30.66KB13.30KB▼ 56.61%
assets/images/screenshot-1.png29.55KB12.75KB▼ 56.87%
assets/images/screenshot-5.png93.24KB28.12KB▼ 69.84%
assets/images/screenshot-3.png34.82KB15.40KB▼ 55.76%
assets/images/screenshot-4.png12.46KB6.27KB▼ 49.67%