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: 6.3.1
  • 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

200+ active / 6,267 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-admin/includes/class-wp-filesystem-direct.php+558
    mkdir(): File exists

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.17ms] Passed 4 tests

This is a short check of server-side resources used by Add To Home Screen
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.01 ▼4.57
Dashboard /wp-admin3.36 ▲0.0648.07 ▼0.41
Posts /wp-admin/edit.php3.47 ▲0.1251.79 ▲2.45
Add New Post /wp-admin/post-new.php5.94 ▲0.0595.20 ▲6.85
Media Library /wp-admin/upload.php3.28 ▲0.0535.10 ▲1.84
Add to Home Screen /wp-admin/options-general.php?page=add-to-homescreen-options3.2942.16

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 65 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
wpswmanager_registrations
widget_theysaidso_widget
webappmanifest_content

Browser metrics Passed 4 tests

A check of browser resources used by Add To Home Screen
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲11213.61 ▼0.783.67 ▲1.5439.62 ▼2.53
Dashboard /wp-admin2,255 ▲634.82 ▼0.12111.37 ▼0.7840.13 ▼2.60
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0439.12 ▼0.1834.26 ▼0.68
Add New Post /wp-admin/post-new.php1,524 ▲1023.16 ▲5.63595.78 ▼93.3649.95 ▲5.36
Media Library /wp-admin/upload.php1,395 ▲74.27 ▲0.1093.88 ▼7.9840.71 ▼5.32
Add to Home Screen /wp-admin/options-general.php?page=add-to-homescreen-options1,1613.7556.7272.96

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+558
    mkdir(): File exists
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • webappmanifest_content
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • wpswmanager_registrations
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > 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 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/class-wp-add-to-homescreen-plugin.php:3
    • > 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-stats.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: homescreen, applications, banner, web, progressive web applications...

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

The principal PHP file in "Add To Home Screen" v. 0.3.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("add-to-home-screen.php" instead of "wp-add-to-homescreen.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin7,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

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
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

Often times overlooked, PNG files can occupy unnecessary space in 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%