88% add-to-home-screen-wp

Code Review | Add to home screen WP Plugin

WordPress plugin Add to home screen WP Plugin scored 88% from 54 tests.

About plugin

  • Plugin page: add-to-home-scree...
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.2
  • WordPress version: 5.9.2
  • First release: Mar 21, 2013
  • Latest release: Apr 14, 2020
  • Number of updates: 77
  • Update frequency: every 33.5 days
  • Top authors: tulipwork (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

4,000+ active / 54,142 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼298.40ms] Passed 4 tests

An overview of server-side resources used by Add to home screen WP Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▼0.0052.20 ▼0.45
Dashboard /wp-admin3.47 ▲0.0632.88 ▼0.22
Posts /wp-admin/edit.php3.70 ▲0.0637.80 ▲1.17
Add New Post /wp-admin/post-new.php6.94 ▼0.0390.24 ▼1,192.07
Media Library /wp-admin/upload.php3.35 ▲0.0624.88 ▼0.85
ATHS Options /wp-admin/options-general.php?page=add_to_home_screen_options3.3823.04

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add to home screen WP Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,774 ▲2016.24 ▲0.606.18 ▼0.302.32 ▼0.48
Dashboard /wp-admin2,893 ▲356.14 ▼0.03115.82 ▼19.01154.41 ▼8.89
Posts /wp-admin/edit.php2,690 ▲183.23 ▼0.0063.48 ▼1.88134.72 ▼6.59
Add New Post /wp-admin/post-new.php1,693 ▲2720.65 ▲1.18433.83 ▲29.66159.38 ▲0.58
Media Library /wp-admin/upload.php1,703 ▲25.51 ▲0.04140.64 ▲2.38186.33 ▲2.84
ATHS Options /wp-admin/options-general.php?page=add_to_home_screen_options2,1037.96192.64400.25

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=add_to_home_screen_options
    • > User deprecated in wp-includes/functions.php+5326
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=add_to_home_screen_options
    • > User deprecated in wp-includes/functions.php+5326
    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=add_to_home_screen_options
    • > Warning in wp-content/plugins/add-to-home-screen-wp/options.php+127
    Use of undefined constant drop - assumed 'drop' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=add_to_home_screen_options
    • > Warning in wp-content/plugins/add-to-home-screen-wp/options.php+128
    Use of undefined constant bubble - assumed 'bubble' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=add_to_home_screen_options
    • > Warning in wp-content/plugins/add-to-home-screen-wp/options.php+129
    Use of undefined constant fade - assumed 'fade' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=add_to_home_screen_options
    • > Warning in wp-content/plugins/add-to-home-screen-wp/options.php+220
    Use of undefined constant homeonly - assumed 'homeonly' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=add_to_home_screen_options
    • > Warning in wp-content/plugins/add-to-home-screen-wp/options.php+221
    Use of undefined constant allpages - assumed 'allpages' (this will throw an Error in a future version of PHP)

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-to-home-screen-wp/index.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/add-to-home-screen-wp/options.php:47

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • Screenshots: Please describe screenshot #6 in add-to-home-screen-wp/assets to your readme.txt
The official readme.txt might help

add-to-home-screen-wp/index.php 92% from 13 tests

"Add to home screen WP Plugin" version 1.8'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: It is recommended to name the main PHP file as the plugin slug ("add-to-home-screen-wp.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,591 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PO File32171,101714
PHP23073470
JavaScript15616272
CSS11640135

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.16
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods4100.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.20MB with 0.14MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
banner-772x250.png203.10KB57.61KB▼ 71.63%