66% trs-sales-count-down

Code Review | TRS Sales Count Down

WordPress plugin TRS Sales Count Down scored66%from 54 tests.

About plugin

  • Plugin page: trs-sales-count-down
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.1
  • WordPress version: 6.3.1
  • First release: Jun 20, 2020
  • Latest release: Oct 28, 2022
  • Number of updates: 11
  • Update frequency: every 78.2 days
  • Top authors: alishanvr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /813 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
Installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼7.06ms] Passed 4 tests

Analyzing server-side resources used by TRS Sales Count Down
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3044.82 ▲4.06
Dashboard /wp-admin3.59 ▲0.2948.46 ▼7.32
Posts /wp-admin/edit.php3.64 ▲0.2949.75 ▼2.65
Add New Post /wp-admin/post-new.php6.13 ▲0.2484.05 ▼17.99
Media Library /wp-admin/upload.php3.45 ▲0.2239.19 ▼0.26

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 1,101 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for TRS Sales Count Down
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲17213.52 ▼0.868.67 ▲6.9139.68 ▼6.52
Dashboard /wp-admin2,231 ▲515.82 ▲0.1588.72 ▼8.2239.40 ▼7.03
Posts /wp-admin/edit.php2,135 ▲352.29 ▲0.2636.57 ▼1.1234.41 ▼2.61
Add New Post /wp-admin/post-new.php1,555 ▲2523.25 ▲0.08666.40 ▼6.5236.27 ▼21.38
Media Library /wp-admin/upload.php1,436 ▲394.46 ▲0.2796.44 ▼12.7042.38 ▼5.71

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

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/Resources/bin/translation-status.php
  • 68× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Exception\\ExceptionInterface' not found in wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/Exception/LogicException.php:19
    • > PHP Fatal error
      Trait 'Carbon\\Traits\\Cast' not found in wp-content/plugins/trs-sales-count-down/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/Dumper/IcuResFileDumper.php:21
    • > PHP Fatal error
      Trait 'Carbon\\Traits\\ObjectInitialisation' not found in wp-content/plugins/trs-sales-count-down/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php on line 32
    • > PHP Notice
      Undefined index: argv in wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/Resources/bin/translation-status.php on line 47
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/Loader/IniFileLoader.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Loader\\LoaderInterface' not found in wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/Loader/ArrayLoader.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\Translation\\TranslatorInterface' not found in wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/IdentityTranslator.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Reader\\TranslationReaderInterface' not found in wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/Reader/TranslationReader.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/trs-sales-count-down/vendor/symfony/translation/Dumper/PoFileDumper.php:21

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 issues were found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
  • Screenshots: These screenshots need descriptions #1, #2, #3 in trs-sales-count-down/assets to your readme.txt
The official readme.txt might help

trs-sales-count-down/class-trs-sales-count-down.php 69% from 13 tests

"TRS Sales Count Down" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("trs-sales-count-down.php" instead of "class-trs-sales-count-down.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "4.5")
  • Domain Path: The domain path folder was not found ("/languages/")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/trs-sales-count-down/vendor/bin/carbon.bat
      • wp-content/plugins/trs-sales-count-down/vendor/nesbot/carbon/bin/carbon.bat
36,591 lines of code in 798 files:
LanguageFilesBlank linesComment linesLines of code
PHP7605,65422,87231,104
XSD392482,803
CSS9267911,224
JSON700625
Markdown71520405
JavaScript63751363
XML10045
DOS Batch2008
YAML2018
Bourne Shell1316

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 139)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity20.30
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity139.00
Code structure
Namespaces22
Interfaces15
Traits21
Classes77
▷ Abstract classes45.19%
▷ Concrete classes7394.81%
▷ Final classes22.74%
Methods1,349
▷ Static methods30622.68%
▷ Public methods1,18187.55%
▷ Protected methods926.82%
▷ Private methods765.63%
Functions253
▷ Named functions5019.76%
▷ Anonymous functions20380.24%
Constants74
▷ Global constants45.41%
▷ Class constants7094.59%
▷ Public constants70100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/simple-style.png5.28KB2.66KB▼ 49.72%
assets/images/nobe-style.png11.77KB6.60KB▼ 43.94%
assets/images/fly-out-styles.png4.33KB1.92KB▼ 55.59%
assets/images/white-block.png11.94KB4.72KB▼ 60.48%
assets/images/flip-modern.png5.03KB2.75KB▼ 45.45%