68% post-to-google-my-business

Code Review | Post to Google My Business (Google Business Profile)

WordPress plugin Post to Google My Business (Google Business Profile) scored68%from 54 tests.

About plugin

  • Plugin page: post-to-google-my...
  • Plugin version: 3.1.18
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 15, 2018
  • Latest release: Nov 29, 2023
  • Number of updates: 167
  • Update frequency: every 12.5 days
  • Top authors: tycoon12344 (100%)

Code review

54 tests

User reviews

118 reviews

Install metrics

9,000+ active /273,970 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.82MB] [CPU: ▲32.99ms] 75% from 4 tests

Server-side resources used by Post to Google My Business (Google Business Profile)
Please take the time to fix the following items
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.82MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.33 ▲5.8769.17 ▲26.26
Dashboard /wp-admin9.35 ▲6.0585.53 ▲35.72
Posts /wp-admin/edit.php9.36 ▲6.0094.35 ▲50.04
Add New Post /wp-admin/post-new.php11.26 ▲5.38116.57 ▲25.34
Media Library /wp-admin/upload.php9.36 ▲6.1376.88 ▲44.65
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.3669.98

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 501 new files
Database: no new tables, 16 new options
New WordPress options
widget_recent-posts
mbp_version
mbp_quick_post_settings
fs_active_plugins
widget_theysaidso_widget
pgmb_evergreen_settings
mbp_post_type_settings
mbp_misc
db_upgraded
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Post to Google My Business (Google Business Profile): an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,006 ▲25914.83 ▲0.121.54 ▼0.0930.26 ▼14.54
Dashboard /wp-admin2,414 ▲2366.38 ▲0.45121.44 ▲12.7345.45 ▲2.35
Posts /wp-admin/edit.php2,350 ▲2503.48 ▲1.5356.99 ▲19.1633.99 ▼2.15
Add New Post /wp-admin/post-new.php1,593 ▲6721.34 ▼1.81713.47 ▲22.8638.68 ▼22.51
Media Library /wp-admin/upload.php1,488 ▲884.41 ▲0.1683.13 ▼10.4245.08 ▲3.57
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,3273.2048.3127.17

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/post-to-google-my-business/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 16 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • mbp_google_settings
    • mbp_post_type_settings
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • fs_debug_mode
    • mbp_version
    • pgmb_evergreen_settings
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/post-to-google-my-business/vendor/a5hleyrich/wp-background-processing/tests/bootstrap.php
    • > /wp-content/plugins/post-to-google-my-business/post-to-google-my-business.php
  • 129× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'PGMB\\Metabox\\JSMetaboxInterface' not found in wp-content/plugins/post-to-google-my-business/src/Metabox/PostCreationMetabox.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'PGMB\\Vendor\\Cron\\AbstractField' not found in wp-content/plugins/post-to-google-my-business/vendor-prefixed/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PGMB\otifications\\BasicNotification' not found in wp-content/plugins/post-to-google-my-business/src/Notifications/FeatureNotification.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/post-to-google-my-business/vendor-prefixed/html2text/html2text/test/SpanTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PGMB\\Vendor\\Cron\\AbstractField' not found in wp-content/plugins/post-to-google-my-business/vendor-prefixed/dragonmantank/cron-expression/src/Cron/YearField.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'PGMB\\Upgrader\\Upgrade' not found in wp-content/plugins/post-to-google-my-business/src/Upgrader/Upgrade_2_2_11.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/post-to-google-my-business/vendor-prefixed/html2text/html2text/test/InsTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/post-to-google-my-business/vendor-prefixed/html2text/html2text/test/PrintTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PGMB\\Admin\\AbstractPage' not found in wp-content/plugins/post-to-google-my-business/src/Admin/PostCampaignsUpsell.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'PGMB\\EventManagement\\SubscriberInterface' not found in wp-content/plugins/post-to-google-my-business/src/Subscriber/SubPostListAjaxSubscriber.php:9

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: local search, gmb, google places, google my business posts, google plus...

post-to-google-my-business/post-to-google-my-business.php Passed 13 tests

Analyzing the main PHP file in "Post to Google My Business (Google Business Profile)" version 3.1.18
84 characters long description:
Automatically create a post on Google My Business when creating a new WordPress post

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
Everything looks great! No dangerous files found in this plugin82,260 lines of code in 409 files:
LanguageFilesBlank linesComment linesLines of code
PHP31510,87221,63545,813
JSON100027,734
PO File41,6522,0204,199
JavaScript425396152,922
Markdown82650691
CSS176319367
Bourne Shell12311147
XML71630144
YAML3152126
Sass150103
make14014

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity25.74
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces30
Interfaces24
Traits1
Classes203
▷ Abstract classes115.42%
▷ Concrete classes19294.58%
▷ Final classes10.52%
Methods2,243
▷ Static methods30913.78%
▷ Public methods1,73277.22%
▷ Protected methods893.97%
▷ Private methods42218.81%
Functions163
▷ Named functions10363.19%
▷ Anonymous functions6036.81%
Constants194
▷ Global constants10051.55%
▷ Class constants9448.45%
▷ Public constants94100.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
22 PNG files occupy 0.31MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/features/3_0_0_multi_account.png19.84KB7.47KB▼ 62.36%
img/video.png0.28KB0.28KB0.00%
img/promotional/evergreen-content.png22.58KB10.19KB▼ 54.85%
css/images/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
img/promotional/post-campaigns.png45.82KB16.69KB▼ 63.58%