10% wp-smartbanner

Code Review | WP Smart Banner

WordPress plugin WP Smart Banner scored10%from 54 tests.

About plugin

  • Plugin page: wp-smartbanner
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.5.3
  • WordPress version: 6.3.1
  • First release: Nov 10, 2020
  • Latest release: Nov 10, 2020
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: yoeridekker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,283 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/wp-smartbanner/class-wp-smartbanner.php+118
    Use of undefined constant ACF_BASENAME - assumed 'ACF_BASENAME' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.88MB] [CPU: ▼54.34ms] Passed 4 tests

Analyzing server-side resources used by WP Smart Banner
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.366.14 ▼34.74
Dashboard /wp-admin2.12 ▼1.186.48 ▼41.13
Posts /wp-admin/edit.php2.12 ▼1.237.16 ▼43.32
Add New Post /wp-admin/post-new.php2.12 ▼3.766.13 ▼98.17
Media Library /wp-admin/upload.php2.12 ▼1.107.63 ▼28.25

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WP Smart Banner
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7713.29 ▼1.173.40 ▲1.4948.39 ▲8.38
Dashboard /wp-admin2,225 ▲334.85 ▼0.08111.53 ▼1.5642.18 ▲0.52
Posts /wp-admin/edit.php2,102 ▲132.01 ▼0.0334.43 ▼3.5732.23 ▼0.73
Add New Post /wp-admin/post-new.php1,527 ▲817.69 ▼5.54690.18 ▲20.6566.30 ▲15.70
Media Library /wp-admin/upload.php1,404 ▲134.23 ▲0.0398.44 ▼2.2441.07 ▼7.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/wp-smartbanner/class-wp-smartbanner.php+118
    Use of undefined constant ACF_BASENAME - assumed 'ACF_BASENAME' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Smartbanner' not found in wp-content/plugins/wp-smartbanner/includes/admin/class-wp-smartbanner-options.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: android, banner, ios, mobile

wp-smartbanner/wp-smartbanner.php Passed 13 tests

The primary PHP file in "WP Smart Banner" version 1.0.1 is used by WordPress to initiate all plugin functionality
62 characters long description:
A customisable WordPress smart app banner for iOS and Android.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected1,084 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP3110437505
JavaScript4952452
CSS211127

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity28.00
▷ Minimum class complexity22.00
▷ Maximum class complexity34.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods39100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.46MB with 0.41MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png233.83KB26.36KB▼ 88.73%
assets/screenshot-1.png235.10KB21.98KB▼ 90.65%