83% gospel-resource-hub

Code Review | Gospel Resource Hub

WordPress plugin Gospel Resource Hub scored83%from 54 tests.

About plugin

  • Plugin page: gospel-resource-hub
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 1, 2017
  • Latest release: May 2, 2017
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: dkjensen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /663 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.54ms] Passed 4 tests

This is a short check of server-side resources used by Gospel Resource Hub
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0835.87 ▼2.42
Dashboard /wp-admin3.34 ▲0.0446.87 ▼4.06
Posts /wp-admin/edit.php3.39 ▲0.0448.15 ▲2.08
Add New Post /wp-admin/post-new.php5.92 ▲0.0488.99 ▼10.64
Media Library /wp-admin/upload.php3.26 ▲0.0334.60 ▼1.03
Gospel Resource Hub /wp-admin/options-general.php?page=gospel-resource-hub3.2736.56

Server storage [IO: ▲0.08MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_grh_filters
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Gospel Resource Hub: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.25 ▼1.105.37 ▲3.6242.69 ▲0.43
Dashboard /wp-admin2,213 ▲254.88 ▼0.01109.51 ▲2.7742.80 ▼3.26
Posts /wp-admin/edit.php2,096 ▲72.01 ▼0.0438.57 ▲2.8439.19 ▲2.95
Add New Post /wp-admin/post-new.php1,517 ▼2517.62 ▼0.66683.73 ▲42.8455.13 ▲0.48
Media Library /wp-admin/upload.php1,392 ▲44.24 ▲0.1092.05 ▼4.2840.16 ▼3.53
Gospel Resource Hub /wp-admin/options-general.php?page=gospel-resource-hub1,0573.1437.7526.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_grh_filters
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Please fix the following
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gospel-resource-hub/includes/admin/class-gospel-resource-hub-settings.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Gospel_Resource_Hub_i18n' not found in wp-content/plugins/gospel-resource-hub/includes/i18n/class-polylang-gospel-resource-hub-i18n.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/gospel-resource-hub/includes/template-filters.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gospel-resource-hub/gospel-resource-hub.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/gospel-resource-hub/includes/class-grh-query.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/gospel-resource-hub/includes/shortcodes/gospel-resource-hub-shortcode.php:64
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_class() in wp-content/plugins/gospel-resource-hub/templates/content-resource.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gospel-resource-hub/includes/widgets/widget-gospel-resource-hub-filters.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 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
There were not plugin tags detected

gospel-resource-hub/gospel-resource-hub.php 77% from 13 tests

Analyzing the main PHP file in "Gospel Resource Hub" version 1.0.3
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")

Code Analysis 97% from 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 detected1,667 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP133974421,583
JavaScript118857
Markdown117027

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 278)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity49.43
▷ Minimum class complexity1.00
▷ Maximum class complexity278.00
Average method complexity13.56
▷ Minimum method complexity1.00
▷ Maximum method complexity278.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes114.29%
Methods27
▷ Static methods13.70%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected