78% mcw-pwa

Code Review | Minimum Configuration WordPress PWA

WordPress plugin Minimum Configuration WordPress PWA scored78%from 54 tests.

About plugin

  • Plugin page: mcw-pwa
  • Plugin version: 0.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.1.0
  • WordPress version: 6.3.1
  • First release: Dec 24, 2017
  • Latest release: Mar 11, 2019
  • Number of updates: 42
  • Update frequency: every 10.6 days
  • Top authors: tyohan (92.86%)ivankristianto (9.52%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,032 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼2.51ms] Passed 4 tests

Analyzing server-side resources used by Minimum Configuration WordPress PWA
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1234.40 ▼8.37
Dashboard /wp-admin3.51 ▲0.2148.92 ▼2.76
Posts /wp-admin/edit.php3.56 ▲0.2151.74 ▲5.13
Add New Post /wp-admin/post-new.php6.03 ▲0.1496.75 ▲8.31
Media Library /wp-admin/upload.php3.37 ▲0.1437.07 ▼4.05
MCW PWA Settings /wp-admin/options-general.php?page=mcw_setting_page3.3437.83

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Minimum Configuration WordPress PWA
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲11813.16 ▼1.238.67 ▲6.7746.16 ▼1.89
Dashboard /wp-admin2,210 ▲195.91 ▲0.96101.61 ▼6.4439.71 ▼2.37
Posts /wp-admin/edit.php2,093 ▲71.99 ▼0.0542.69 ▲5.8735.39 ▲1.09
Add New Post /wp-admin/post-new.php1,549 ▲723.16 ▲5.00658.78 ▲51.7852.82 ▼6.11
Media Library /wp-admin/upload.php1,392 ▲14.20 ▼0.0095.40 ▼7.5941.82 ▼2.29
MCW PWA Settings /wp-admin/options-general.php?page=mcw_setting_page8412.0225.7030.74

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mcw-pwa/MCW_PWA.php
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'MCW_PWA_DIRincludes/MCW_PWA_Module.php' (include_path='.:/usr/share/php') in wp-content/plugins/mcw-pwa/includes/MCW_PWA_LazyLoad.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'MCW_PWA_DIRincludes/MCW_PWA_Module.php' (include_path='.:/usr/share/php') in wp-content/plugins/mcw-pwa/includes/MCW_PWA_Monitor.php on line 7
    • > PHP Warning
      Use of undefined constant MCW_PWA_DIR - assumed 'MCW_PWA_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/mcw-pwa/includes/service_workers/MCW_PWA_Service_Worker.php on line 13
    • > PHP Warning
      Use of undefined constant MCW_PWA_DIR - assumed 'MCW_PWA_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/mcw-pwa/includes/MCW_PWA_LazyLoad.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'MCW_PWA_DIR/includes/service_workers/MCW_PWA_Service_Worker.php' (include_path='.:/usr/share/php') in wp-content/plugins/mcw-pwa/includes/MCW_PWA_Settings.php on line 3
    • > PHP Warning
      require_once(MCW_PWA_DIR/includes/service_workers/MCW_PWA_Service_Worker.php): failed to open stream: No such file or directory in wp-content/plugins/mcw-pwa/includes/MCW_PWA_Settings.php on line 3
    • > PHP Warning
      require_once(MCW_PWA_DIRincludes/MCW_PWA_Module.php): failed to open stream: No such file or directory in wp-content/plugins/mcw-pwa/includes/MCW_PWA_Assets.php on line 2
    • > PHP Warning
      require_once(MCW_PWA_DIRincludes/MCW_PWA_Module.php): failed to open stream: No such file or directory in wp-content/plugins/mcw-pwa/includes/service_workers/MCW_PWA_Service_Worker.php on line 13
    • > PHP Warning
      require_once(MCW_PWA_DIRincludes/MCW_PWA_Module.php): failed to open stream: No such file or directory in wp-content/plugins/mcw-pwa/includes/MCW_PWA_LazyLoad.php on line 2
    • > PHP Warning
      Use of undefined constant MCW_PWA_DIR - assumed 'MCW_PWA_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/mcw-pwa/includes/MCW_PWA_Assets.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: amp, accelerator mobile page, workbox, minimum config, lazy loading...

mcw-pwa/MCW_PWA.php 77% from 13 tests

Analyzing the main PHP file in "Minimum Configuration WordPress PWA" version 0.2.3
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mcw-pwa.php" instead of "MCW_PWA.php")
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin8,789 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript291,5464,6395,402
PHP141,1628,7292,696
HTML45130385
JSON400154
Markdown6520151
INI1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity8.10
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity1.10
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits4
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods705
▷ Static methods60.85%
▷ Public methods69298.16%
▷ Protected methods111.56%
▷ Private methods20.28%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png5.53KB3.02KB▼ 45.43%