10% mobile-app-banners

Code Review | Mobile App Banners

WordPress plugin Mobile App Banners scored10%from 54 tests.

About plugin

  • Plugin page: mobile-app-banners
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-5.1.1
  • WordPress version: 6.3.1
  • First release: Apr 9, 2019
  • Latest release: Apr 13, 2019
  • Number of updates: 8
  • Update frequency: every 0.9 days
  • Top authors: winyourbrand (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,344 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/mobile-app-banners/index.php+782
    Function create_function() is deprecated

Server metrics [RAM: ▼1.72MB] [CPU: ▼55.80ms] Passed 4 tests

A check of server-side resources used by Mobile App Banners
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.189.42 ▼29.74
Dashboard /wp-admin2.30 ▼1.048.10 ▼59.27
Posts /wp-admin/edit.php2.30 ▼1.0511.08 ▼40.66
Add New Post /wp-admin/post-new.php2.30 ▼3.587.63 ▼93.53
Media Library /wp-admin/upload.php2.30 ▼0.937.06 ▼29.04
Mobile App Banners /wp-admin/options-general.php?page=mobile_app_banners-setting-admin2.308.07

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_mobile_app_android_widget
theysaidso_admin_options
widget_recent-posts
widget_mobile_app_banners_widget
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Mobile App Banners
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8314.38 ▲0.001.87 ▲0.0841.89 ▼0.87
Dashboard /wp-admin2,210 ▲335.55 ▼0.1086.76 ▼8.4839.90 ▼1.22
Posts /wp-admin/edit.php2,115 ▲151.98 ▲0.0135.47 ▼2.7237.57 ▲4.69
Add New Post /wp-admin/post-new.php6,248 ▲4,71726.09 ▲2.95862.13 ▲212.0471.82 ▲11.60
Media Library /wp-admin/upload.php1,412 ▲124.22 ▲0.0096.74 ▼14.4147.75 ▲1.30
Mobile App Banners /wp-admin/options-general.php?page=mobile_app_banners-setting-admin9202.0125.5837.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/mobile-app-banners/index.php+782
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_mobile_app_banners_widget
    • theysaidso_admin_options
    • widget_mobile_app_android_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > Deprecated in wp-content/plugins/mobile-app-banners/index.php+989
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > Warning in wp-content/plugins/mobile-app-banners/index.php(782) : runtime-created function+1
    Use of undefined constant mobile_app_banners_widget - assumed 'mobile_app_banners_widget' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > Warning in wp-content/plugins/mobile-app-banners/index.php(989) : runtime-created function+1
    Use of undefined constant mobile_app_android_widget - assumed 'mobile_app_android_widget' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > Warning in wp-content/plugins/mobile-app-banners/index.php+243
    Use of undefined constant placeholder - assumed 'placeholder' (this will throw an Error in a future version of PHP)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > Warning in wp-content/plugins/mobile-app-banners/index.php+234
    Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > Notice in wp-content/plugins/mobile-app-banners/index.php+246
    Undefined index: default
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > Warning in wp-content/plugins/mobile-app-banners/index.php+234
    Use of undefined constant desc - assumed 'desc' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=mobile_app_banners-setting-admin
    • > Notice in wp-content/plugins/mobile-app-banners/index.php+247
    Undefined index: desc

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mobile-app-banners/index.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Easily add "Download on the App Store" and "Download for Android" badges using widgets or [app-store-download id=yourid] and [android-download id=yourid] shortcodes)
  • Tags: There are too many tags (15 tag instead of maximum 10)
You can look at the official readme.txt

mobile-app-banners/index.php 85% from 13 tests

"Mobile App Banners" version 3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mobile-app-banners.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 352 characters long)

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
Good job! No executable or dangerous file extensions detected733 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1207198584
PO File24242149

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity17.50
▷ Minimum class complexity14.00
▷ Maximum class complexity20.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/download_on_the_app_store.png10.81KB5.88KB▼ 45.60%
images/download_for_android.png12.50KB4.38KB▼ 64.96%