88% dw-promobar

Code Review | DW Promobar

WordPress plugin DW Promobar scored 88% from 54 tests.

About plugin

  • Plugin page: dw-promobar
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 5.9.2
  • First release: Dec 26, 2013
  • Latest release: Sep 19, 2014
  • Number of updates: 15
  • Update frequency: every 17.8 days
  • Top authors: designwall (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

2,000+ active / 48,811 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼291.43ms] Passed 4 tests

A check of server-side resources used by DW Promobar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1258.61 ▲6.24
Dashboard /wp-admin3.56 ▲0.1535.41 ▼1.59
Posts /wp-admin/edit.php3.78 ▲0.1541.83 ▲3.96
Add New Post /wp-admin/post-new.php7.02 ▲0.0595.56 ▼1,168.79
Media Library /wp-admin/upload.php3.44 ▲0.1424.84 ▲0.69
DW PromoBar /wp-admin/options-general.php?page=dw_promobar4.3937.63

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for DW Promobar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,886 ▲13216.76 ▲1.098.83 ▲2.432.26 ▼0.78
Dashboard /wp-admin3,010 ▲1497.21 ▲1.04128.50 ▼5.50153.52 ▼4.21
Posts /wp-admin/edit.php2,813 ▲1253.81 ▲0.5674.27 ▲10.16155.26 ▲9.10
Add New Post /wp-admin/post-new.php1,773 ▲11215.40 ▼1.43406.17 ▲3.04170.02 ▲19.15
Media Library /wp-admin/upload.php1,814 ▲1166.39 ▲0.86137.49 ▼3.84185.75 ▲2.81
DW PromoBar /wp-admin/options-general.php?page=dw_promobar6,8014.47113.90133.54

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dw_promobar
    • > Notice in wp-content/plugins/dw-promobar/dw-promobar-option.php+409
    Undefined property: stdClass::$regular

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/dw-promobar/dw-promobar.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dw-promobar/dw-promobar-option.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Back-end settings), #2 (Front-end appearance)
The official readme.txt might help

dw-promobar/dw-promobar.php Passed 13 tests

The principal PHP file in "DW Promobar" v. 1.0.4 is loaded by WordPress automatically on each request
45 characters long description:
Custom promotion bar for your wordpress site.

Code Analysis Passed 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
No dangerous file extensions were detected2,134 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5111113903
PHP213331767
LESS2520254
CSS330210

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.27MB with 0.18MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png124.51KB49.63KB▼ 60.14%
screenshot-1.png154.79KB45.49KB▼ 70.61%