77% wp-trovaprezzi

Code Review | Wp TrovaPrezzi Wordpress / WooCommerce Plugin

WordPress plugin Wp TrovaPrezzi Wordpress / WooCommerce Plugin scored77%from 54 tests.

About plugin

  • Plugin page: wp-trovaprezzi
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.5
  • WordPress version: 6.3.1
  • First release: Apr 8, 2016
  • Latest release: Apr 18, 2016
  • Number of updates: 19
  • Update frequency: every 26.2 days
  • Top authors: wemiura (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /1,665 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.79ms] Passed 4 tests

A check of server-side resources used by Wp TrovaPrezzi Wordpress / WooCommerce Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.69 ▼7.64
Dashboard /wp-admin3.31 ▲0.0148.12 ▼5.88
Posts /wp-admin/edit.php3.36 ▲0.0151.33 ▼2.02
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.64 ▼19.63
Media Library /wp-admin/upload.php3.23 ▲0.0137.44 ▼0.15

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 47 new files
Database: no new tables, 14 new options
New WordPress options
wp_trovaprezzi_category_tp_settings
wp_trovaprezzi_brand_settings
widget_recent-posts
wp_trovaprezzi_eancode_settings
theysaidso_admin_options
wp_trovaprezzi_description_settings
widget_theysaidso_widget
wp_trovaprezzi_code_settings
wp_trovaprezzi_custom_shipping_cost_settings
db_upgraded
...

Browser metrics Passed 4 tests

An overview of browser requirements for Wp TrovaPrezzi Wordpress / WooCommerce Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.68 ▼0.701.65 ▼0.8643.31 ▼3.65
Dashboard /wp-admin2,206 ▲184.85 ▼1.05102.34 ▼12.8438.05 ▼5.50
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0140.82 ▲5.5733.86 ▼0.23
Add New Post /wp-admin/post-new.php1,533 ▲1423.13 ▲0.09646.06 ▼18.7450.30 ▼17.61
Media Library /wp-admin/upload.php1,388 ▲34.19 ▲0.0397.94 ▼16.2043.20 ▼3.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 14 options in the database
    • wp_trovaprezzi_description_settings
    • wp_trovaprezzi_custom_shipping_cost_settings
    • wp_trovaprezzi_brand_settings
    • wp_trovaprezzi_eancode_settings
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • wp_trovaprezzi_category_tp_settings
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-trovaprezzi/public/partials/wp-trova-prezzi-free-public-display.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-trovaprezzi/admin/class-wp-trova-prezzi-free-admin.php on line 1140
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/template.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-trovaprezzi/admin/class-wp-trova-prezzi-free-admin.php on line 1140
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/template.php): failed to open stream: No such file or directory in wp-content/plugins/wp-trovaprezzi/admin/class-wp-trova-prezzi-free-admin.php on line 1140
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-trovaprezzi/admin/partials/wp-trova-prezzi-free-admin-display.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_tp_create_query() in wp-content/plugins/wp-trovaprezzi/admin/partials/wp-trova-prezzi-free-admin-display-products.php:23

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 86% 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
These attributes need to be fixed: You can take inspiration from this readme.txt

wp-trovaprezzi/wp-trova-prezzi-free.php 77% from 13 tests

The principal PHP file in "Wp TrovaPrezzi Wordpress / WooCommerce Plugin" v. 1.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-trovaprezzi.php" instead of "wp-trova-prezzi-free.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 207 characters long)

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
Good job! No executable or dangerous file extensions detected2,841 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP143135641,478
JavaScript6153119541
PO File2166187439
CSS65330383

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods76
▷ Static methods22.63%
▷ Public methods7193.42%
▷ Protected methods00.00%
▷ Private methods56.58%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/tp16.png0.23KB0.28KB0.00%
admin/skins/square/red2x.png7.51KB3.07KB▼ 59.18%
admin/skins/square/red.png4.94KB1.83KB▼ 62.99%
admin/img/tp24_off.png1.68KB1.27KB▼ 24.49%
admin/img/tp24_on.png1.62KB1.24KB▼ 23.51%