77% demomentsomtres-wc-cadeau

Code Review | DeMomentSomTres Gift Ticket

WordPress plugin DeMomentSomTres Gift Ticket scored77%from 54 tests.

About plugin

  • Plugin page: demomentsomtres-w...
  • Plugin version: 202201120000...
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Dec 12, 2018
  • Latest release: Jan 12, 2022
  • Number of updates: 22
  • Update frequency: every 68.8 days
  • Top authors: marcqueralt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,020 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.09MB] [CPU: ▲3.96ms] Passed 4 tests

Analyzing server-side resources used by DeMomentSomTres Gift Ticket
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.59 ▲1.0849.67 ▲5.52
Dashboard /wp-admin4.45 ▲1.0657.84 ▼5.46
Posts /wp-admin/edit.php4.50 ▲1.1053.22 ▲3.42
Add New Post /wp-admin/post-new.php7.03 ▲1.10100.48 ▲12.35
Media Library /wp-admin/upload.php4.37 ▲1.1048.82 ▲13.34
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins4.3843.85

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 327 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

DeMomentSomTres Gift Ticket: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.77 ▲0.411.74 ▼0.1040.00 ▼6.35
Dashboard /wp-admin2,236 ▲625.67 ▲0.0688.08 ▼5.6543.89 ▲7.51
Posts /wp-admin/edit.php2,147 ▲502.18 ▲0.1738.22 ▲2.3437.23 ▲1.96
Add New Post /wp-admin/post-new.php1,583 ▲17724.94 ▲7.20618.00 ▼63.5563.81 ▲5.14
Media Library /wp-admin/upload.php1,443 ▲404.17 ▲0.0897.56 ▼3.8947.37 ▲0.58
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins1,0452.0524.6630.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/lib/php-css-parser/tests/quickdump.php
  • 193× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/src/Positioner/TableCell.php:19
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/lib/fonts/dompdf_font_family_cache.php on line 81
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/lib/fonts/dompdf_font_family_cache.php on line 39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/demomentsomtres-wc-cadeau/lib/class-tgm-plugin-activation.php:1910
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\Block' not found in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/src/Renderer/TableRowGroup.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/src/FrameDecorator/Table.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\PrimitiveValue' not found in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Value/URL.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Property\\AtRule' not found in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php:12
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/lib/fonts/dompdf_font_family_cache.php on line 71
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Header' not found in wp-content/plugins/demomentsomtres-wc-cadeau/lib/dompdf/lib/php-font-lib/src/FontLib/EOT/Header.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: all posts, category, archives

demomentsomtres-wc-cadeau/dms3-woocommerce-cadeau.php 77% from 13 tests

The principal PHP file in "DeMomentSomTres Gift Ticket" v. 202201120000... is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("demomentsomtres-wc-cadeau.php" instead of "dms3-woocommerce-cadeau.php")
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "202201120000...")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin39,047 lines of code in 249 files:
LanguageFilesBlank linesComment linesLines of code
PHP1928,73316,64236,924
Markdown72760942
CSS3113460650
XML752212
JSON500135
PO File24046104
YAML416363
HTML10017

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity35.61
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces33
Interfaces5
Traits0
Classes185
▷ Abstract classes126.49%
▷ Concrete classes17393.51%
▷ Final classes00.00%
Methods2,063
▷ Static methods874.22%
▷ Public methods1,76085.31%
▷ Protected methods20810.08%
▷ Private methods954.60%
Functions18
▷ Named functions316.67%
▷ Anonymous functions1583.33%
Constants175
▷ Global constants21.14%
▷ Class constants17398.86%
▷ Public constants173100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
lib/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%