10% add-to-home-screen

Code Review | Add To Home Screen

WordPress plugin Add To Home Screen scored 10% from 54 tests.

About plugin

  • Plugin page: add-to-home-screen
  • Plugin version: 0.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4.1
  • WordPress version: 5.9.2
  • First release: Mar 30, 2016
  • Latest release: Apr 16, 2016
  • Number of updates: 9
  • Update frequency: every 1.9 days
  • Top authors: delapuente (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active / 5,658 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-admin/includes/class-wp-filesystem-direct.php+545
    mkdir(): File exists

Server metrics [RAM: ▲0.23MB] [CPU: ▼295.53ms] Passed 4 tests

A check of server-side resources used by Add To Home Screen
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2357.51 ▲2.20
Dashboard /wp-admin3.63 ▲0.2334.23 ▲0.96
Posts /wp-admin/edit.php3.92 ▲0.2837.80 ▼3.54
Add New Post /wp-admin/post-new.php7.16 ▲0.1994.23 ▼1,181.73
Media Library /wp-admin/upload.php3.58 ▲0.2927.13 ▲3.27
Add to Home Screen /wp-admin/options-general.php?page=add-to-homescreen-options3.5728.23

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 65 new files
Database: no new tables, 2 new options
New WordPress options
webappmanifest_content
wpswmanager_registrations

Browser metrics Passed 4 tests

An overview of browser requirements for Add To Home Screen
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,857 ▲11316.46 ▲0.798.46 ▲1.652.19 ▼0.01
Dashboard /wp-admin2,965 ▲1046.02 ▼0.15118.41 ▼39.46155.64 ▼9.25
Posts /wp-admin/edit.php2,693 ▲83.23 ▼0.1464.00 ▼2.12141.75 ▼5.52
Add New Post /wp-admin/post-new.php1,755 ▲9021.01 ▲1.54429.25 ▲14.79155.24 ▼3.80
Media Library /wp-admin/upload.php1,703 ▲55.53 ▲0.01142.16 ▼0.13187.62 ▼1.06
Add to Home Screen /wp-admin/options-general.php?page=add-to-homescreen-options1,5705.3384.60146.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-admin/includes/class-wp-filesystem-direct.php+545
    mkdir(): File exists
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • webappmanifest_content
    • wpswmanager_registrations

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-to-home-screen/class-wp-add-to-homescreen-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-to-home-screen/wp-add-to-homescreen.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/add-to-home-screen/lib/pages/admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-to-home-screen/class-wp-add-to-homescreen-plugin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-to-home-screen/class-wp-add-to-homescreen-stats.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: applications, progressive, web, banner, progressive web applications...

add-to-home-screen/wp-add-to-homescreen.php 85% from 13 tests

"Add To Home Screen" version 0.3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-to-home-screen.php" instead of "wp-add-to-homescreen.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected7,771 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript181,2111,1115,650
PHP182332481,059
Markdown52010466
JSON910350
SVG111133
CSS1200108
Bourne Shell1005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.82
▷ Minimum class complexity2.00
▷ Maximum class complexity39.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods102
▷ Static methods1312.75%
▷ Public methods8078.43%
▷ Protected methods00.00%
▷ Private methods2221.57%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.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.33MB with 0.22MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/imgs/rocket.png15.06KB5.73KB▼ 61.96%
lib/imgs/android.png321.16KB96.87KB▼ 69.84%