78% pwa-for-wp

Code Review | PWA for WP & AMP

WordPress plugin PWA for WP & AMP scored78%from 54 tests.

About plugin

  • Plugin page: pwa-for-wp
  • Plugin version: 1.7.64
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Aug 16, 2018
  • Latest release: Nov 22, 2023
  • Number of updates: 259
  • Update frequency: every 7.4 days
  • Top authors: magazine3 (87.64%)ampforwp (8.11%)mohammed_kaludi (5.02%)

Code review

54 tests

User reviews

219 reviews

Install metrics

20,000+ active /1,157,111 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.32MB] [CPU: ▲6.28ms] 75% from 4 tests

A check of server-side resources used by PWA for WP & AMP
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 568.70ms on /wp-admin/admin.php?page=pwaforwp)
PageMemory (MB)CPU Time (ms)
Home /4.19 ▲0.7241.36 ▼0.84
Dashboard /wp-admin4.83 ▲1.5257.52 ▲7.60
Posts /wp-admin/edit.php4.88 ▲1.5262.26 ▲10.58
Add New Post /wp-admin/post-new.php7.43 ▲1.5494.34 ▲7.77
Media Library /wp-admin/upload.php4.75 ▲1.5246.21 ▲12.34
Upgrade To Premium /wp-admin/admin.php?page=javasctipt:void(0);4.4734.10
Settings /wp-admin/admin.php?page=pwaforwp4.87568.70

Server storage [IO: ▲1.39MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • The plugin illegally modified 3 files (40.46KB) outside of "wp-content/plugins/pwa-for-wp/" and "wp-content/uploads/"
    • (new file) pwa-register-sw.js
    • (new file) pwa-sw.js
    • (new file) pwa-manifest.json
Filesystem: 76 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
wisdom_admin_emails
widget_theysaidso_widget
pwaforwp_activation_date
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
wisdom_last_track_time

Browser metrics Passed 4 tests

This is an overview of browser requirements for PWA for WP & AMP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,994 ▲20714.39 ▼0.011.64 ▼0.2038.94 ▼5.17
Dashboard /wp-admin2,356 ▲1825.71 ▲0.0799.64 ▲3.6881.84 ▲37.07
Posts /wp-admin/edit.php2,285 ▲1852.29 ▲0.3548.37 ▲7.1538.86 ▲3.62
Add New Post /wp-admin/post-new.php1,630 ▲9423.40 ▲0.11757.81 ▲146.6354.67 ▼6.42
Media Library /wp-admin/upload.php1,573 ▲1734.31 ▲0.18104.73 ▲6.7561.43 ▲19.43
Upgrade To Premium /wp-admin/admin.php?page=javasctipt:void(0);280.410.083.91
Settings /wp-admin/admin.php?page=pwaforwp6,0505.10142.91113.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • wisdom_last_track_time
    • pwaforwp_activation_date
    • wisdom_admin_emails
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=pwaforwp
    • > Warning in wp-content/plugins/pwa-for-wp/admin/settings.php+2770
    get_headers(https://wp.com/pwa-sw.js): failed to open stream: Connection refused

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=javasctipt:void(0);
    • > Network (severe)
    wp-admin/admin.php?page=javasctipt:void(0); - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6, #7, #8, #9 in pwa-for-wp/assets to your readme.txt
The official readme.txt might help

pwa-for-wp/pwa-for-wp.php Passed 13 tests

The principal PHP file in "PWA for WP & AMP" v. 1.7.64 is loaded by WordPress automatically on each request
116 characters long description:
We are bringing the power of the Progressive Web Apps to the WP & AMP to take the user experience to the next level!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected15,141 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP181,1731,9076,331
JavaScript175121713,831
CSS6458653,494
PO File2375408887
Markdown11460523
SVG20051
HTML12024

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity64.90
▷ Minimum class complexity5.00
▷ Maximum class complexity186.00
Average method complexity6.80
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods106
▷ Static methods76.60%
▷ Public methods10397.17%
▷ Protected methods32.83%
▷ Private methods00.00%
Functions141
▷ Named functions13595.74%
▷ Anonymous functions64.26%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/offline-forms-for-pwa-for-wp.png5.51KB5.90KB0.00%
images/multilingual-compatibility-for-pwa.png5.28KB5.54KB0.00%
images/pwa-to-apk-plugin.png4.76KB4.98KB0.00%
images/offers.png19.62KB7.99KB▼ 59.26%
images/buddypress-for-pwaforwp.png7.39KB7.70KB0.00%