78% church-social

Code Review | Church Social

WordPress plugin Church Social scored 78% from 54 tests.

About plugin

  • Plugin page: church-social
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5.1
  • WordPress version: 5.8.1
  • First release: Mar 31, 2016
  • Latest release: Oct 2, 2020
  • Number of updates: 28
  • Update frequency: every 58.8 days
  • Top authors: reinink (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 2,213 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Church Social
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1436.21 ▲9.11
Dashboard /wp-admin3.10 ▲0.0445.56 ▲0.25
Posts /wp-admin/edit.php3.15 ▲0.0439.47 ▲4.32
Add New Post /wp-admin/post-new.php5.46 ▲0.0393.61 ▼555.47
Media Library /wp-admin/upload.php3.04 ▲0.0432.72 ▼2.63
Church Social /wp-admin/options-general.php?page=church_social3.0731.90

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
church_social_sermon_archive_page_id
church_social_sermon_copyright_notice
church_social_api_key
widget_church_social_upcoming_events
widget_church_social_recent_sermons
church_social_calendar_page_id
church_social_theme

Browser metrics Passed 4 tests

Church Social: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.93 ▲0.449.51 ▲1.4348.94 ▼2.06
Dashboard /wp-admin2,978 ▲845.89 ▲0.05144.66 ▼13.91115.90 ▲1.19
Posts /wp-admin/edit.php2,741 ▲22.82 ▲0.0264.58 ▼1.0897.14 ▲9.17
Add New Post /wp-admin/post-new.php1,673 ▼1019.11 ▲0.40378.79 ▼33.92115.26 ▼3.27
Media Library /wp-admin/upload.php1,812 ▲55.03 ▲0.03154.20 ▼8.43118.57 ▼4.82
Church Social /wp-admin/options-general.php?page=church_social1,2162.4859.8082.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 2 options in the database
    • widget_church_social_upcoming_events
    • widget_church_social_recent_sermons

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/church-social/views/upcoming_events.php
    • > /wp-content/plugins/church-social/views/recent_sermons.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/church-social/libs/RecentSermonsWidget.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/church-social/views/event.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/church-social/views/calendar.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/church-social/libs/UpcomingEventsWidget.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/church-social/libs/UpcomingEventsWidget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/church-social/views/admin.php:12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/church-social/views/sermons.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/church-social/views/sermon.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% 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
4 plugin tags: church, events, calendar, sermons

church-social/church_social.php 92% from 13 tests

The primary PHP file in "Church Social" version 1.5.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("church-social.php" instead of "church_social.php")

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
Success! There were no dangerous files found in this plugin12,497 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JSON20011,537
PHP1514711843
Sass4650108
JavaScript1207
CSS2002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity9.43
▷ Minimum class complexity2.00
▷ Maximum class complexity22.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2790.00%
▷ Protected methods310.00%
▷ Private methods00.00%
Functions9
▷ Named functions00.00%
▷ Anonymous functions9100.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin