78% dn-shopping-discounts

Code Review | DN Shopping discounts

WordPress plugin DN Shopping discounts scored78%from 54 tests.

About plugin

  • Plugin page: dn-shopping-disco...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.3-5.5.3
  • WordPress version: 6.3.1
  • First release: Jun 3, 2020
  • Latest release: Nov 9, 2020
  • Number of updates: 12
  • Update frequency: every 13.3 days
  • Top authors: digireturn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /497 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.65MB] [CPU: ▼24.28ms] Passed 4 tests

Analyzing server-side resources used by DN Shopping discounts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.31 ▼9.96
Dashboard /wp-admin3.29 ▼0.0234.86 ▼19.53
Posts /wp-admin/edit.php3.35 ▼0.0140.90 ▼9.75
Add New Post /wp-admin/post-new.php3.25 ▼2.6438.16 ▼57.87
Media Library /wp-admin/upload.php3.29 ▲0.0632.11 ▼5.44
Add New /wp-admin/post-new.php?post_type=dn_discounts3.1932.92
Shopping discounts /wp-admin/edit.php?post_type=dn_discounts3.3340.68
Test /wp-admin/edit.php?post_type=dn_discounts&page=dn_discounts_test_page3.2728.28

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

DN Shopping discounts: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8214.46 ▼0.271.84 ▲0.1848.90 ▲2.05
Dashboard /wp-admin2,249 ▲695.62 ▲0.0296.19 ▲6.6841.11 ▲0.95
Posts /wp-admin/edit.php2,151 ▲512.03 ▲0.0140.76 ▲0.2437.65 ▲3.74
Add New Post /wp-admin/post-new.php1,581 ▲5321.09 ▼2.08596.30 ▼88.6555.41 ▲1.89
Media Library /wp-admin/upload.php1,454 ▲574.14 ▼0.05101.43 ▲3.6143.62 ▼0.64
Add New /wp-admin/post-new.php?post_type=dn_discounts1,5432.6051.8562.01
Shopping discounts /wp-admin/edit.php?post_type=dn_discounts1,1601.9233.1832.03
Test /wp-admin/edit.php?post_type=dn_discounts&page=dn_discounts_test_page8482.0125.7222.09

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=dn_discounts
    • > Notice in wp-content/plugins/dn-shopping-discounts/dn-shopping-discounts.php+106
    Undefined index: post_type
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=dn_discounts&page=dn_discounts_test_page
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/dn-shopping-discounts/dn-shopping-discounts.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: sconto sul totale, discount, woocommerce, sconto sulla spesa, sconti...

dn-shopping-discounts/dn-shopping-discounts.php 85% from 13 tests

The principal PHP file in "DN Shopping discounts" v. 1.0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 219 characters long)
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin275 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1326178
PO File1303388
JavaScript1006
CSS1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png11.87KB3.06KB▼ 74.20%