84% iworks-pwa

Code Review | PWA — easy way to Progressive Web App

WordPress plugin PWA — easy way to Progressive Web App scored84%from 54 tests.

About plugin

  • Plugin page: iworks-pwa
  • Plugin version: 1.5.7
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 18, 2021
  • Latest release: Nov 17, 2023
  • Number of updates: 51
  • Update frequency: every 19.1 days
  • Top authors: iworks (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /19,015 total downloads

Benchmarks

Plugin footprint 83% from 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.81MB] [CPU: ▲0.93ms] Passed 4 tests

Server-side resources used by PWA — easy way to Progressive Web App
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.19 ▲0.7348.46 ▲8.27
Dashboard /wp-admin4.16 ▲0.8254.74 ▼6.81
Posts /wp-admin/edit.php4.21 ▲0.8557.06 ▲11.67
Add New Post /wp-admin/post-new.php6.76 ▲0.8887.20 ▼7.18
Media Library /wp-admin/upload.php4.09 ▲0.8642.30 ▲9.45
PWA /wp-admin/options-general.php?page=iworks_pwa_index4.1968.37

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 84 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
iworks_pwa_check_urls_error
iworks_pwa_meta_viewport
widget_recent-comments

Browser metrics Passed 4 tests

PWA — easy way to Progressive Web App: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲16014.49 ▲0.141.75 ▲0.0339.51 ▼3.86
Dashboard /wp-admin2,256 ▲755.65 ▼0.0696.51 ▼15.3144.28 ▼4.29
Posts /wp-admin/edit.php2,167 ▲642.30 ▲0.3449.79 ▲9.8832.71 ▼4.12
Add New Post /wp-admin/post-new.php1,577 ▲4223.33 ▼1.81654.73 ▲38.6136.64 ▼29.70
Media Library /wp-admin/upload.php1,467 ▲674.30 ▲0.11105.88 ▲9.8047.51 ▲3.01
PWA /wp-admin/options-general.php?page=iworks_pwa_index2,3054.77103.9578.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • theysaidso_admin_options
    • iworks_pwa_check_urls_error
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • iworks_pwa_meta_viewport

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_PWA_Integrations' not found in wp-content/plugins/iworks-pwa/includes/iworks/pwa/integrations/class-iworks-pwa-integrations-menu-icons.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_PWA_Integrations' not found in wp-content/plugins/iworks-pwa/includes/iworks/pwa/integrations/class-iworks-pwa-integrations-og.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_PWA_Integrations' not found in wp-content/plugins/iworks-pwa/includes/iworks/pwa/integrations/class-iworks-pwa-integrations-wpml.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/iworks-pwa/assets/templates/no-ssl.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots lack descriptions #2, #3, #4, #5, #6 in iworks-pwa/assets to your readme.txt
The official readme.txt is a good inspiration

iworks-pwa/iworks-pwa.php Passed 13 tests

Analyzing the main PHP file in "PWA — easy way to Progressive Web App" version 1.5.7
45 characters long description:
Your easy way to Progressive Web Application.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin5,183 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP222981,3364,361
JavaScript954116442
CSS7249193
Sass180138
HTML10036
SVG30011
XML1002

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 193)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity46.64
▷ Minimum class complexity2.00
▷ Maximum class complexity392.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity193.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes214.29%
▷ Concrete classes1285.71%
▷ Final classes00.00%
Methods194
▷ Static methods10.52%
▷ Public methods11961.34%
▷ Protected methods2211.34%
▷ Private methods5327.32%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
32 compressed PNG files occupy 0.09MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/iworks/options/assets/styles/images/ui-icons_ffffff_256x240.png3.54KB3.86KB0.00%
assets/images/icons/favicon/android-icon-72x72.png1.72KB1.73KB0.00%
assets/images/icons/favicon/ms-icon-70x70.png1.64KB1.65KB0.00%
assets/images/icons/favicon/favicon-16x16.png0.43KB0.44KB0.00%
assets/images/icons/favicon/apple-icon-60x60.png1.42KB1.43KB0.00%