79% church-metrics-dashboard

Code Review | Church Metrics Dashboard

WordPress plugin Church Metrics Dashboard scored79%from 54 tests.

About plugin

  • Plugin page: church-metrics-da...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.4.2
  • WordPress version: 6.3.1
  • First release: Aug 1, 2015
  • Latest release: Feb 11, 2016
  • Number of updates: 29
  • Update frequency: every 6.7 days
  • Top authors: danielmilner (89.66%)firetree (13.79%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,295 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.99MB] [CPU: ▲5.08ms] Passed 4 tests

Server-side resources used by Church Metrics Dashboard
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.40 ▲0.9346.23 ▲7.13
Dashboard /wp-admin4.32 ▲1.0251.40 ▲2.15
Posts /wp-admin/edit.php4.35 ▲0.9956.01 ▲5.64
Add New Post /wp-admin/post-new.php6.91 ▲1.03105.54 ▲5.39
Media Library /wp-admin/upload.php4.24 ▲1.0144.92 ▲12.44
API Settings /wp-admin/edit.php?post_type=cm_dash_widgets&page=cm_dash_widgets_settings4.5838.53
All Metrics /wp-admin/edit.php?post_type=cm_dash_widgets4.2938.33
Add New Metric /wp-admin/post-new.php?post_type=cm_dash_widgets4.0532.23

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 265 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Church Metrics Dashboard
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲10713.29 ▼1.094.43 ▲2.7046.14 ▲3.17
Dashboard /wp-admin2,254 ▲664.88 ▼1.03109.46 ▲6.8843.67 ▲0.11
Posts /wp-admin/edit.php2,140 ▲512.23 ▲0.2444.25 ▲4.7636.35 ▼0.01
Add New Post /wp-admin/post-new.php1,567 ▲4723.21 ▲0.13654.40 ▼28.1354.19 ▲3.42
Media Library /wp-admin/upload.php1,439 ▲514.30 ▲0.0296.62 ▲2.0845.05 ▲2.74
API Settings /wp-admin/edit.php?post_type=cm_dash_widgets&page=cm_dash_widgets_settings8442.1526.7223.00
All Metrics /wp-admin/edit.php?post_type=cm_dash_widgets1,1331.9932.5429.51
Add New Metric /wp-admin/post-new.php?post_type=cm_dash_widgets280.440.063.68

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
Please take a closer look at the following
  • 15× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/church-metrics-dashboard/lib/cmb2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/church-metrics-dashboard/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/church-metrics-dashboard/lib/cmb2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/church-metrics-dashboard/lib/cmb2/example-functions.php:68
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/church-metrics-dashboard/church-metrics-dashboard.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/church-metrics-dashboard/lib/cmb2/init.php:119
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/church-metrics-dashboard/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/church-metrics-dashboard/lib/cmb2/bootstrap.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/church-metrics-dashboard/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/church-metrics-dashboard/lib/cmb-field-select2/cmb-field-select2.php:31

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=cm_dash_widgets
    • > Network (severe)
    wp-admin/post-new.php?post_type=cm_dash_widgets - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: stats, church, metrics, dashboard

church-metrics-dashboard/church-metrics-dashboard.php Passed 13 tests

The main PHP file in "Church Metrics Dashboard" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
75 characters long description:
Allows you to create Dashboard Widgets to display data from Church Metrics.

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
Everything looks great! No dangerous files found in this plugin86,269 lines of code in 213 files:
LanguageFilesBlank linesComment linesLines of code
XML20047,741
PO File948,87311,78920,306
PHP282,4003,4407,263
CSS81,1621,0414,645
JavaScript528447664,089
Sass11168231,116
Markdown62050558
JSON800277
YAML290152
Bourne Shell2427122

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity33.76
▷ Minimum class complexity1.00
▷ Maximum class complexity173.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes29
▷ Abstract classes26.90%
▷ Concrete classes2793.10%
▷ Final classes00.00%
Methods416
▷ Static methods296.97%
▷ Public methods39995.91%
▷ Protected methods122.88%
▷ Private methods51.20%
Functions42
▷ Named functions3583.33%
▷ Anonymous functions716.67%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
20 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
lib/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
lib/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
lib/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
lib/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%