10% demomentsomtres-promotions

Code Review | DeMomentSomTres Promotions

WordPress plugin DeMomentSomTres Promotions scored10%from 54 tests.

About plugin

  • Plugin page: demomentsomtres-p...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.9.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2013
  • Latest release: May 19, 2014
  • Number of updates: 3
  • Update frequency: every 140.3 days
  • Top authors: marcqueralt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,088 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/demomentsomtres-promotions/demomentsomtres-promotions.php+82
    Methods with the same name as their class will not be constructors in a future version of PHP; dmst_promotions_widget has a deprecated constructor

Server metrics [RAM: ▼1.90MB] [CPU: ▼56.68ms] Passed 4 tests

A check of server-side resources used by DeMomentSomTres Promotions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.76 ▼32.52
Dashboard /wp-admin2.10 ▼1.205.56 ▼58.89
Posts /wp-admin/edit.php2.10 ▼1.256.93 ▼46.06
Add New Post /wp-admin/post-new.php2.10 ▼3.786.14 ▼89.26
Media Library /wp-admin/upload.php2.10 ▼1.125.45 ▼28.12
Add Promotion /wp-admin/post-new.php?post_type=promotions2.105.94
Promo Types /wp-admin/edit-tags.php?taxonomy=promo-type&post_type=promotions2.116.00
Promotions /wp-admin/edit.php?post_type=promotions2.116.63

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_dmst_promotions_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for DeMomentSomTres Promotions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8813.71 ▼0.911.68 ▼0.0543.27 ▲3.36
Dashboard /wp-admin2,237 ▲495.81 ▲0.7195.02 ▼6.6638.62 ▼1.00
Posts /wp-admin/edit.php2,117 ▲282.02 ▲0.0335.52 ▼7.6531.62 ▼0.39
Add New Post /wp-admin/post-new.php1,560 ▲1823.39 ▲4.95702.97 ▲93.8855.63 ▲0.72
Media Library /wp-admin/upload.php1,419 ▲344.14 ▼0.04111.07 ▲6.0447.50 ▲4.19
Add Promotion /wp-admin/post-new.php?post_type=promotions2,7997.74176.1072.40
Promo Types /wp-admin/edit-tags.php?taxonomy=promo-type&post_type=promotions1,2902.1326.5128.70
Promotions /wp-admin/edit.php?post_type=promotions1,1321.9330.4630.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/demomentsomtres-promotions/demomentsomtres-promotions.php+82
    Methods with the same name as their class will not be constructors in a future version of PHP; dmst_promotions_widget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_dmst_promotions_widget
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • 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
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=promotions
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/demomentsomtres-promotions/demomentsomtres-promotions.php+82
    Methods with the same name as their class will not be constructors in a future version of PHP; dmst_promotions_widget has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=promotions
    • > POST request to /wp-admin/admin-ajax.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in dmst_promotions_widget is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/demomentsomtres-promotions/demomentsomtres-promotions.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: expiration, custom post-type, promotions

demomentsomtres-promotions/demomentsomtres-promotions.php Passed 13 tests

The entry point to "DeMomentSomTres Promotions" version 1.2.1 is a PHP file that has certain tags in its header comment area
48 characters long description:
Promotions custom post-type with expiration date

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin128 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21312119
JavaScript1089

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin