78% cpt-woo-integration

Code Review | Custom Post Type Woocommerce Integration

WordPress plugin Custom Post Type Woocommerce Integration scored78%from 54 tests.

About plugin

  • Plugin page: cpt-woo-integration
  • Plugin version: 1.1.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Aug 6, 2023
  • Latest release: Nov 25, 2023
  • Number of updates: 26
  • Update frequency: every 4.3 days
  • Top authors: tinysolution (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20+ active /980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼1.91ms] Passed 4 tests

A check of server-side resources used by Custom Post Type Woocommerce Integration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1441.88 ▼0.70
Dashboard /wp-admin3.44 ▲0.0945.12 ▼14.13
Posts /wp-admin/edit.php3.55 ▲0.1948.41 ▲3.83
Add New Post /wp-admin/post-new.php6.02 ▲0.1399.55 ▲9.57
Media Library /wp-admin/upload.php3.36 ▲0.1335.06 ▲3.38

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 42 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
cptwooint_settings
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
cptwooint_plugin_version
widget_recent-comments
cptwooint_plugin_activation_time

Browser metrics Passed 4 tests

Custom Post Type Woocommerce Integration: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8514.12 ▼0.132.12 ▲0.5441.44 ▼0.99
Dashboard /wp-admin2,212 ▲315.62 ▼0.1089.50 ▼9.1741.10 ▼2.57
Posts /wp-admin/edit.php2,134 ▲342.37 ▲0.4040.80 ▲2.1736.11 ▼0.96
Add New Post /wp-admin/post-new.php1,550 ▲2023.20 ▲0.24674.91 ▲29.8657.74 ▲5.84
Media Library /wp-admin/upload.php1,424 ▲244.26 ▲0.0998.14 ▼0.8843.08 ▲2.72

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • cptwooint_settings
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • cptwooint_plugin_activation_time
    • cptwooint_plugin_version
    • widget_recent-comments

Smoke tests 50% 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 0% 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
  • 13× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/Controllers/Admin/AdminMenu.php
    • > /wp-content/plugins/cpt-woo-integration/cpt-woo-integration.php
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/Controllers/AssetsController.php
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/Helpers/Fns.php
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/Controllers/Notice/BlackFriday.php
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/Controllers/AdminController.php
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/Abs/Base.php
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/Traits/CptProductDataStoreReadTrait.php
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/cptwooint.php
    • > /wp-content/plugins/cpt-woo-integration/TinyApp/Controllers/Dependencies.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Trait 'TinySolutions\\cptwooint\\Traits\\SingletonTrait' not found in wp-content/plugins/cpt-woo-integration/TinyApp/Controllers/Admin/Api.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Product_Data_Store_CPT' not found in wp-content/plugins/cpt-woo-integration/TinyApp/Modal/CPTProductDataStore.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order_Item_Product' not found in wp-content/plugins/cpt-woo-integration/TinyApp/Modal/CPTOrderItemProduct.php:8
    • > PHP Fatal error
      Trait 'TinySolutions\\cptwooint\\Traits\\SingletonTrait' not found in wp-content/plugins/cpt-woo-integration/TinyApp/Controllers/Notice/Review.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 22 tag instead of maximum 10
The official readme.txt might help

cpt-woo-integration/cpt-woo-integration.php 92% from 13 tests

Analyzing the main PHP file in "Custom Post Type Woocommerce Integration" version 1.1.5
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin3,333 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP316981,1903,315
JavaScript205011
JSON1005
CSS2002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.38
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces10
Interfaces0
Traits2
Classes22
▷ Abstract classes14.55%
▷ Concrete classes2195.45%
▷ Final classes14.76%
Methods138
▷ Static methods3827.54%
▷ Public methods12288.41%
▷ Protected methods10.72%
▷ Private methods1510.87%
Functions12
▷ Named functions18.33%
▷ Anonymous functions1191.67%
Constants10
▷ Global constants660.00%
▷ Class constants440.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/cpt-woo-icon-150x150.png9.20KB4.14KB▼ 54.96%