88% add-smart-app-banner

Code Review | Add Smart App Banner

WordPress plugin Add Smart App Banner scored 88% from 54 tests.

About plugin

  • Plugin page: add-smart-app-banner
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.3
  • WordPress version: 5.8.1
  • First release: Nov 29, 2015
  • Latest release: Nov 29, 2015
  • Number of updates: 2
  • Update frequency: every 2.5 days
  • Top authors: omarnas (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

500+ active / 4,545 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by Add Smart App Banner
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1336.23 ▲18.59
Dashboard /wp-admin3.08 ▲0.0248.85 ▲0.17
Posts /wp-admin/edit.php3.13 ▲0.0143.68 ▼6.41
Add New Post /wp-admin/post-new.php5.43 ▼0.0093.28 ▼556.02
Media Library /wp-admin/upload.php3.02 ▲0.0131.94 ▲1.76
Smart App Banners /wp-admin/options-general.php?page=Smart-App-Banners3.0230.48

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Add Smart App Banner: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,694 ▲4716.39 ▲0.8014.64 ▲5.1247.37 ▼1.77
Dashboard /wp-admin2,977 ▲406.03 ▼0.13149.78 ▼0.86117.03 ▲3.90
Posts /wp-admin/edit.php2,744 ▲52.73 ▲0.0158.94 ▼3.9791.38 ▲3.05
Add New Post /wp-admin/post-new.php1,675 ▲17718.79 ▼0.03364.76 ▼4.77103.94 ▼5.15
Media Library /wp-admin/upload.php1,812 ▲25.03 ▼0.00143.66 ▼8.71122.59 ▼3.90
Smart App Banners /wp-admin/options-general.php?page=Smart-App-Banners1,3742.1054.4078.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=Smart-App-Banners
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=Smart-App-Banners
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/add-smart-app-banner/sab-options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-smart-app-banner/add-smart-app-banner.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Modified settings panel with Smart App Banner.), #2 (How the smart banner will look on mobile devices)
The official readme.txt is a good inspiration

add-smart-app-banner/add-smart-app-banner.php Passed 13 tests

Analyzing the main PHP file in "Add Smart App Banner" version 1.0
63 characters long description:
Add a Smart App Banner to your website to increase app installs

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin590 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP23418313
CSS1464244
JavaScript10033

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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.09MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png43.06KB18.29KB▼ 57.53%
screenshot-1.png48.59KB20.60KB▼ 57.60%