84% mobile-banner

Code Review | Mobile Banner

WordPress plugin Mobile Banner scored84%from 54 tests.

About plugin

  • Plugin page: mobile-banner
  • Plugin version: 1.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: May 2, 2019
  • Latest release: Sep 12, 2023
  • Number of updates: 25
  • Update frequency: every 63.8 days
  • Top authors: avantman42 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,391 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.04MB] [CPU: ▼6.95ms] Passed 4 tests

A check of server-side resources used by Mobile Banner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.06 ▼4.81
Dashboard /wp-admin3.36 ▲0.0144.93 ▼17.67
Posts /wp-admin/edit.php3.41 ▲0.0558.14 ▲11.11
Add New Post /wp-admin/post-new.php5.94 ▲0.0582.43 ▼9.91
Media Library /wp-admin/upload.php3.28 ▲0.0536.37 ▲4.58
Mobile Banner /wp-admin/options-general.php?page=mobilebanner_config3.2528.71

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 15 new options
New WordPress options
widget_recent-comments
can_compress_scripts
mobilebanner_url
mobilebanner_chknewtab
mobilebanner_bgcolour
mobilebanner_chkclose
mobilebanner_cookiedays
widget_recent-posts
mobilebanner_textcolour
mobilebanner_width
...

Browser metrics Passed 4 tests

Mobile Banner: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲14413.67 ▼0.545.83 ▲3.9944.05 ▲0.22
Dashboard /wp-admin2,207 ▲164.89 ▼1.0198.52 ▼5.5838.62 ▼2.54
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0240.90 ▼0.0733.75 ▲1.31
Add New Post /wp-admin/post-new.php1,545 ▲2618.42 ▼4.75607.37 ▼119.1153.20 ▼24.84
Media Library /wp-admin/upload.php1,392 ▲14.16 ▼0.0195.50 ▼2.6544.87 ▲0.08
Mobile Banner /wp-admin/options-general.php?page=mobilebanner_config8772.0522.3526.90

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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 take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/mobile-banner/mobile-banner.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/mobile-banner/public/banner.php:72

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: phone, link, tablet, url, mobile...

mobile-banner/mobile-banner.php Passed 13 tests

Analyzing the main PHP file in "Mobile Banner" version 1.6
84 characters long description:
Create a banner with a link at the bottom of the screen, when viewed on mobile only.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin266 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP33964207
JavaScript262745
CSS12114

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
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
public/close.png1.98KB1.23KB▼ 37.96%