74% pinterest-for-woocommerce

Code Review | Pinterest for WooCommerce

WordPress plugin Pinterest for WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: pinterest-for-woo...
  • Plugin version: 1.3.15
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Oct 25, 2021
  • Latest release: Nov 28, 2023
  • Number of updates: 57
  • Update frequency: every 13.6 days
  • Top authors: automattic (91.23%)ecgan (10.53%)

Code review

54 tests

User reviews

44 reviews

Install metrics

300,000+ active /3,300,182 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.33MB] [CPU: ▼1.63ms] Passed 4 tests

Server-side resources used by Pinterest for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3740.78 ▲6.54
Dashboard /wp-admin3.67 ▲0.3350.64 ▼10.41
Posts /wp-admin/edit.php3.72 ▲0.3748.34 ▼1.44
Add New Post /wp-admin/post-new.php6.19 ▲0.3092.62 ▼1.20
Media Library /wp-admin/upload.php3.53 ▲0.3040.63 ▲7.70

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 365 new files
Database: no new tables, 7 new options
New WordPress options
pinterest-for-woocommerce-update-version
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pinterest for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3614.34 ▼0.031.75 ▲0.2243.63 ▲6.92
Dashboard /wp-admin2,203 ▲295.61 ▼0.0293.62 ▼4.3239.68 ▼6.40
Posts /wp-admin/edit.php2,109 ▲92.02 ▲0.0640.14 ▼1.4236.56 ▲0.29
Add New Post /wp-admin/post-new.php1,539 ▲1323.20 ▲0.12611.43 ▼64.8255.23 ▼5.43
Media Library /wp-admin/upload.php1,405 ▲114.20 ▼0.0297.05 ▼0.1442.04 ▼0.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/pinterest-for-woocommerce/uninstall.php+37
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • pinterest-for-woocommerce-update-version
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 21× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Automattic\\WooCommerce\\Pinterest\\Exception\\PinterestException' not found in wp-content/plugins/pinterest-for-woocommerce/src/Exception/PinterestApiLocaleException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/pinterest-for-woocommerce/vendor/defuse/php-encryption/src/Exception/IOException.php:5
    • > PHP Fatal error
      Trait 'Automattic\\WooCommerce\\ActionSchedulerJobFramework\\Utilities\\BatchSize' not found in wp-content/plugins/pinterest-for-woocommerce/vendor/woocommerce/action-scheduler-job-framework/src/Utilities/BatchQueryOffset.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/pinterest-for-woocommerce/vendor/defuse/php-encryption/src/Exception/EnvironmentIsBrokenException.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/pinterest-for-woocommerce/vendor/automattic/jetpack-autoloader/src/jetpack-autoloader/class-autoloader.php' (include_path='.:/usr/share/php') in wp-content/plugins/pinterest-for-woocommerce/vendor/automattic/jetpack-autoloader/src/autoload.php on line 4
    • > PHP Fatal error
      Trait 'Automattic\\WooCommerce\\Pinterest\\Utilities\\Tracks' not found in wp-content/plugins/pinterest-for-woocommerce/class-pinterest-for-woocommerce.php on line 27
    • > PHP Fatal error
      require_once(): Failed opening required 'lib/byte_safe_strings.php' (include_path='.:/usr/share/php') in wp-content/plugins/pinterest-for-woocommerce/vendor/paragonie/random_compat/psalm-autoload.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Pinterest\otes\\Collection\\AbstractNote' not found in wp-content/plugins/pinterest-for-woocommerce/src/Notes/Collection/EnableCatalogSync.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Automattic\\WooCommerce\\Pinterest\\Exception\\PinterestException' not found in wp-content/plugins/pinterest-for-woocommerce/src/Exception/FeedFileOperationsException.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Automattic\\Jetpack\\Autoloader\\jpba6e215da828d2bc2b4b768fa9cb0dec\\al2_12_0\\wp_normalize_path() in wp-content/plugins/pinterest-for-woocommerce/vendor/jetpack-autoloader/class-path-processor.php:73

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: pinterest, woocommerce, advertise

pinterest-for-woocommerce/pinterest-for-woocommerce.php 85% from 13 tests

"Pinterest for WooCommerce" version 1.3.15's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 165 characters long)
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.3" instead of "7.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin21,508 lines of code in 337 files:
LanguageFilesBlank linesComment linesLines of code
PHP1843,7189,89311,927
JavaScript1036381,0505,772
Markdown1880902,155
Sass1127014921
JSON600405
SVG700210
XML211560
CSS41229
make19426
Bourne Shell1203

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity10.06
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces24
Interfaces12
Traits6
Classes140
▷ Abstract classes53.57%
▷ Concrete classes13596.43%
▷ Final classes96.67%
Methods912
▷ Static methods36039.47%
▷ Public methods65772.04%
▷ Protected methods10911.95%
▷ Private methods14616.01%
Functions35
▷ Named functions25.71%
▷ Anonymous functions3394.29%
Constants113
▷ Global constants1412.39%
▷ Class constants9987.61%
▷ Public constants9494.95%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.21MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/landing_welcome.png219.48KB221.34KB0.00%