83% id-services

Code Review | Military Discount

WordPress plugin Military Discount scored83%from 54 tests.

About plugin

  • Plugin page: id-services
  • Plugin version: 4.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.2.0
  • WordPress version: 6.3.1
  • First release: Oct 16, 2017
  • Latest release: Sep 26, 2019
  • Number of updates: 40
  • Update frequency: every 17.7 days
  • Top authors: idservices (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,769 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 gracefully, with no errors

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

Analyzing server-side resources used by Military Discount
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.42 ▲0.03
Dashboard /wp-admin3.32 ▲0.0154.36 ▼0.40
Posts /wp-admin/edit.php3.37 ▲0.0151.19 ▼0.68
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.18 ▼16.56
Media Library /wp-admin/upload.php3.24 ▲0.0137.63 ▼2.09
menu title /wp-admin/admin.php?page=verifypass3.2830.35

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Military Discount
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.35 ▼0.031.74 ▼0.7044.05 ▲1.56
Dashboard /wp-admin2,195 ▲185.63 ▼0.0294.77 ▼11.4742.37 ▼0.57
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0534.65 ▼4.9134.05 ▼0.09
Add New Post /wp-admin/post-new.php1,525 ▼322.13 ▼1.12783.41 ▲105.2953.74 ▲3.14
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.0098.90 ▼25.0941.64 ▼6.55
menu title /wp-admin/admin.php?page=verifypass1,0612.0524.3930.34

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

Smoke tests 75% 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/admin.php?page=verifypass
    • > Notice in wp-content/plugins/id-services/views/admin.php+131
    Undefined index: tab

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Screenshot #5 (Seller Account: Simple suite of reporting and customization tools. Manage your discounts, export your verified customers and more.) image missing
  • Plugin Name: Please specify the plugin name on the first line ( === Military Discount === )
Please take inspiration from this readme.txt

id-services/verifypass.php 85% from 13 tests

The main file in "Military Discount" v. 4.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 ("id-services.php" instead of "verifypass.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("3.0.1" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin453 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP105647453

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods969.23%
▷ Protected methods00.00%
▷ Private methods430.77%
Functions0
▷ Named functions00.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
15 PNG files occupy 0.45MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
banners/soldier2.png40.48KB42.90KB0.00%
banners/soldier3.png27.96KB29.62KB0.00%
banners/fire1.png27.12KB28.54KB0.00%
banners/girl2.png27.62KB29.49KB0.00%
logo.png31.71KB4.07KB▼ 87.18%