68% premmerce

Code Review | Premmerce

WordPress plugin Premmerce scored68%from 54 tests.

About plugin

  • Plugin page: premmerce
  • Plugin version: 1.3.18
  • PHP compatiblity: 5.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2017
  • Latest release: Aug 11, 2023
  • Number of updates: 42
  • Update frequency: every 48.9 days
  • Top authors: premmerce (100%)

Code review

54 tests

User reviews

32 reviews

Install metrics

900+ active /37,528 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲5.57MB] [CPU: ▲33.86ms] 75% from 4 tests

An overview of server-side resources used by Premmerce
The following require your attention
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.57MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.25 ▲5.7863.23 ▲23.77
Dashboard /wp-admin9.27 ▲5.9685.13 ▲37.59
Posts /wp-admin/edit.php9.27 ▲5.9186.68 ▲44.02
Add New Post /wp-admin/post-new.php10.51 ▲4.62134.57 ▲34.81
Media Library /wp-admin/upload.php9.27 ▲6.0371.31 ▲39.27
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2773.33

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 467 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
db_upgraded
premmerce_version
premmerce_additional_settings
fs_debug_mode
fs_active_plugins
widget_recent-posts
widget_recent-comments
fs_accounts
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Premmerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲11814.39 ▲0.041.56 ▼0.1032.24 ▼8.50
Dashboard /wp-admin2,289 ▲1125.59 ▼0.0794.54 ▲5.8647.17 ▲4.56
Posts /wp-admin/edit.php2,198 ▲981.99 ▼0.0142.49 ▲6.8137.46 ▲0.87
Add New Post /wp-admin/post-new.php1,578 ▲5222.99 ▼0.14681.24 ▲76.5855.51 ▲5.46
Media Library /wp-admin/upload.php1,485 ▲824.23 ▼0.0196.62 ▼4.3545.73 ▲2.50
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1581.6626.8827.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/premmerce/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 11 options
    • widget_recent-comments
    • premmerce_additional_settings
    • widget_theysaidso_widget
    • fs_active_plugins
    • can_compress_scripts
    • widget_recent-posts
    • fs_accounts
    • db_upgraded
    • theysaidso_admin_options
    • premmerce_version
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/premmerce/addons/premmerce-woocommerce-toolkit/views/frontend/product-video.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/premmerce/addons/premmerce-product-comparison/views/frontend/comparison-page-products.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/premmerce/addons/premmerce-product-comparison/views/widget/comparison-widget.php:10
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/premmerce/addons/premmerce-woocommerce-toolkit/views/frontend/product-video.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function premmerce_comparison() in wp-content/plugins/premmerce/addons/premmerce-product-comparison/views/frontend/comparison-btn.php:10
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/premmerce/addons/premmerce-product-comparison/views/widget/comparison-widget.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Premmerce\\SDK\\V2\\Plugin\\PluginInterface' not found in wp-content/plugins/premmerce/src/PremmercePlugin.php:15
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/premmerce/addons/premmerce-product-comparison/views/frontend/comparison-page-categories.php on line 3
    • > PHP Notice
      Undefined variable: urls in wp-content/plugins/premmerce/addons/premmerce-woocommerce-toolkit/views/frontend/product-video.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Yaoi\\Command' not found in wp-content/plugins/premmerce/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php:21
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/premmerce/addons/premmerce-product-comparison/views/frontend/comparison-page-categories.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 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
3 plugin tags: woocommerce plugins bundle, woocommerce tutorial, woocommerce wizard

premmerce/premmerce.php 92% from 13 tests

This is the main PHP file of "Premmerce" version 1.3.18, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.8" instead of "3.0.0")

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
No dangerous file extensions were detected44,302 lines of code in 411 files:
LanguageFilesBlank linesComment linesLines of code
PHP3558,83018,82840,933
PO File66781,2391,752
CSS2411641596
JavaScript911097464
SVG101831290
JSON300150
Markdown4790117

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity59.88
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces21
Interfaces2
Traits0
Classes80
▷ Abstract classes33.75%
▷ Concrete classes7796.25%
▷ Final classes00.00%
Methods1,511
▷ Static methods23715.68%
▷ Public methods1,07170.88%
▷ Protected methods181.19%
▷ Private methods42227.93%
Functions117
▷ Named functions10186.32%
▷ Anonymous functions1613.68%
Constants176
▷ Global constants9855.68%
▷ Class constants7844.32%
▷ Public constants78100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%