84% pwa

Code Review | PWA

WordPress plugin PWA scored84%from 54 tests.

About plugin

  • Plugin page: pwa
  • Plugin version: 0.7.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Jul 12, 2018
  • Latest release: Aug 8, 2023
  • Number of updates: 29
  • Update frequency: every 63.9 days
  • Top authors: westonruter (93.1%)flixos90 (10.34%)

Code review

54 tests

User reviews

21 reviews

Install metrics

30,000+ active /453,918 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.41MB] [CPU: ▼1.04ms] Passed 4 tests

Analyzing server-side resources used by PWA
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4449.84 ▲6.46
Dashboard /wp-admin3.76 ▲0.4262.44 ▼5.71
Posts /wp-admin/edit.php3.79 ▲0.4456.08 ▲0.87
Add New Post /wp-admin/post-new.php6.29 ▲0.40107.74 ▼1.66
Media Library /wp-admin/upload.php3.62 ▲0.4041.28 ▲2.36

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 129 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

PWA: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲10114.36 ▲0.012.27 ▲0.4442.04 ▼1.66
Dashboard /wp-admin2,247 ▲695.72 ▲0.0088.89 ▼28.7543.30 ▲0.23
Posts /wp-admin/edit.php2,152 ▲522.30 ▲0.3642.67 ▲0.7537.68 ▲2.90
Add New Post /wp-admin/post-new.php1,549 ▲2323.56 ▼0.06654.28 ▲7.2135.91 ▼10.57
Media Library /wp-admin/upload.php1,452 ▲494.38 ▲0.21100.64 ▲6.1445.07 ▲2.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
  • 47× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pwa_get_header() in wp-content/plugins/pwa/wp-includes/theme-compat/offline.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pwa/bundled-theme-support/twentyfourteen/offline.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pwa/bundled-theme-support/twentysixteen/offline.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pwa/bundled-theme-support/twentytwentyone/offline.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Service_Worker_Base_Integration' not found in wp-content/plugins/pwa/integrations/class-wp-service-worker-custom-background-integration.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Service_Worker_Base_Integration' not found in wp-content/plugins/pwa/integrations/class-wp-service-worker-site-icon-integration.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PWA_WP\\add_action() in wp-content/plugins/pwa/wp-admin/options-reading-offline-browsing.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'WP_Service_Worker_Component' not found in wp-content/plugins/pwa/wp-includes/components/class-wp-service-worker-configuration-component.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pwa/wp-includes/class-wp.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pwa/bundled-theme-support/twentytwelve/offline.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: service workers, web app manifest, progressive web apps, pwa

pwa/pwa.php Passed 13 tests

The primary PHP file in "PWA" version 0.7.1 is used by WordPress to initiate all plugin functionality
70 characters long description:
Feature plugin to bring Progressive Web App (PWA) capabilities to Core

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected9,345 lines of code in 94 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript381,8614,6666,247
PHP566892,4703,098

PHP code Passed 2 tests

An overview 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.33
Average class complexity10.88
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces1
Interfaces2
Traits0
Classes22
▷ Abstract classes14.55%
▷ Concrete classes2195.45%
▷ Final classes21100.00%
Methods102
▷ Static methods76.86%
▷ Public methods8381.37%
▷ Protected methods1918.63%
▷ Private methods00.00%
Functions73
▷ Named functions5271.23%
▷ Anonymous functions2128.77%
Constants26
▷ Global constants519.23%
▷ Class constants2180.77%
▷ Public constants21100.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
No PNG files were detected