78% wp-facebook-group

Code Review | WP Group Promoter

WordPress plugin WP Group Promoter scored 78% from 54 tests.

About plugin

  • Plugin page: wp-facebook-group
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.0.3
  • WordPress version: 5.9.2
  • First release: Jul 30, 2018
  • Latest release: Sep 28, 2019
  • Number of updates: 48
  • Update frequency: every 8.8 days
  • Top authors: oloyede jamiu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 3,457 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼313.44ms] Passed 4 tests

Server-side resources used by WP Group Promoter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3159.84 ▲2.26
Dashboard /wp-admin3.89 ▲0.4938.35 ▼5.38
Posts /wp-admin/edit.php4.12 ▲0.4842.55 ▲2.14
Add New Post /wp-admin/post-new.php6.14 ▼0.8362.68 ▼1,248.64
Media Library /wp-admin/upload.php3.84 ▲0.5428.99 ▼1.89
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius4.0427.35

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 192 new files
Database: no new tables, 5 new options
New WordPress options
fs_active_plugins
fs_gdpr
fs_api_cache
fs_debug_mode
fs_accounts

Browser metrics Passed 4 tests

Checking browser requirements for WP Group Promoter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,908 ▲15416.13 ▲0.529.82 ▲4.202.73 ▼0.74
Dashboard /wp-admin2,902 ▲416.15 ▼0.06114.13 ▼10.89165.36 ▲6.52
Posts /wp-admin/edit.php2,705 ▲143.23 ▲0.0163.03 ▲0.63152.74 ▲3.03
Add New Post /wp-admin/post-new.php1,759 ▲6321.73 ▲0.40403.53 ▼37.04153.57 ▼4.74
Media Library /wp-admin/upload.php1,710 ▲125.52 ▲0.01149.19 ▲6.68196.71 ▲4.98
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius1,4122.5453.92126.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 5 options
    • fs_gdpr
    • fs_active_plugins
    • fs_api_cache
    • fs_debug_mode
    • fs_accounts

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
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
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-facebook-group/public/partials/kankoz-fg-promoter-public-display.php
    • > /wp-content/plugins/wp-facebook-group/freemius/templates/ajax-loader.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-facebook-group/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-facebook-group/admin/partials/help/help.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-facebook-group/admin/partials/kankoz-fg-promoter-admin-display.php:18
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-facebook-group/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-facebook-group/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-facebook-group/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-facebook-group/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/wp-facebook-group/freemius/templates/partials/network-activation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/wp-facebook-group/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-facebook-group/admin/partials/email-marketing/email-marketing.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: facebook group plugin, facebook join group button, facebook group invite widget, join facebook group

wp-facebook-group/kankoz-fg-promoter.php 85% from 13 tests

The entry point to "WP Group Promoter" version 1.0.8 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-facebook-group.php" instead of "kankoz-fg-promoter.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin41,628 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
PHP1176,81915,85228,846
PO File105,7106,91312,558
JavaScript538113200
CSS122824

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,609)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity72.69
▷ Minimum class complexity1.00
▷ Maximum class complexity2,609.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,121
▷ Static methods17215.34%
▷ Public methods78570.03%
▷ Protected methods151.34%
▷ Private methods32128.64%
Functions95
▷ Named functions95100.00%
▷ Anonymous functions00.00%
Constants119
▷ Global constants9680.67%
▷ Class constants2319.33%
▷ Public constants23100.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
7 PNG files occupy 0.31MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png102.81KB35.69KB▼ 65.29%
assets/icon-128x128.png2.70KB1.41KB▼ 47.86%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/icon-256x256.png4.93KB2.35KB▼ 52.30%