77% simple-facebook-twitter-widget

Code Review | Simple Social Page Widget & Shortcode

WordPress plugin Simple Social Page Widget & Shortcode scored 77% from 54 tests.

About plugin

  • Plugin page: simple-facebook-t...
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.2.2
  • WordPress version: 5.9.2
  • First release: Apr 3, 2015
  • Latest release: Jul 23, 2019
  • Number of updates: 122
  • Update frequency: every 12.9 days
  • Top authors: irkanu (100%)

Code review

54 tests

User reviews

164 reviews

Install metrics

10,000+ active / 161,353 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲3.83MB] [CPU: ▼284.49ms] 75% from 4 tests

Server-side resources used by Simple Social Page Widget & Shortcode
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,800.19ms on /wp-admin/options-general.php?page=simple-facebook-twitter-widget)
PageMemory (MB)CPU Time (ms)
Home /7.68 ▲4.1674.35 ▼1.81
Dashboard /wp-admin7.70 ▲4.2957.96 ▲19.44
Posts /wp-admin/edit.php7.70 ▲4.0661.21 ▲22.35
Add New Post /wp-admin/post-new.php9.79 ▲2.82113.14 ▼1,177.93
Media Library /wp-admin/upload.php7.70 ▲4.4058.84 ▲32.18
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius7.7045.55
Simple Facebook Settings /wp-admin/options-general.php?page=simple-facebook-twitter-widget7.701,800.19

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 219 new files
Database: no new tables, 7 new options
New WordPress options
fs_api_cache
fs_accounts
fs_gdpr
widget_simple_facebook_page_feed_widget
fs_active_plugins
simple-facebook-page-plugin
fs_debug_mode

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Social Page Widget & Shortcode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,811 ▲5716.11 ▲0.5438.56 ▲31.872.24 ▼0.54
Dashboard /wp-admin2,924 ▲736.01 ▼0.15132.45 ▼11.33182.22 ▲26.47
Posts /wp-admin/edit.php2,724 ▲363.24 ▼0.0163.04 ▼1.44147.47 ▲3.36
Add New Post /wp-admin/post-new.php1,650 ▼1117.34 ▲1.34425.03 ▲30.47175.63 ▲0.47
Media Library /wp-admin/upload.php1,725 ▲305.53 ▲0.04163.27 ▲12.31295.21 ▲90.82
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius1,4512.5455.03127.44
Simple Facebook Settings /wp-admin/options-general.php?page=simple-facebook-twitter-widget1,2632.6356.03164.70

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • fs_gdpr
    • simple-facebook-page-plugin
    • fs_api_cache
    • widget_simple_facebook_page_feed_widget
    • fs_active_plugins
    • fs_debug_mode
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/ajax-loader.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simple-facebook-twitter-widget/lib/freemius/templates/account/partials/addon.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: facebook widget, facebook page shortcode, social widget, facebook page widget, social shortcode...

simple-facebook-twitter-widget/simple-facebook-page-plugin.php 85% from 13 tests

This is the main PHP file of "Simple Social Page Widget & Shortcode" version 1.7.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-facebook-twitter-widget.php" instead of "simple-facebook-page-plugin.php")

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin43,939 lines of code in 173 files:
LanguageFilesBlank linesComment linesLines of code
PHP1056,49114,96926,978
PO File125,5716,68812,092
Sass28399772,515
JavaScript81501111,493
CSS133328549
Markdown3800247
JSON20037
YAML22028

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,360)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity74.09
▷ Minimum class complexity1.00
▷ Maximum class complexity2,360.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods1,051
▷ Static methods16615.79%
▷ Public methods73770.12%
▷ Protected methods151.43%
▷ Private methods29928.45%
Functions116
▷ Named functions116100.00%
▷ Anonymous functions00.00%
Constants126
▷ Global constants10684.13%
▷ Class constants2015.87%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
lib/chosen/chosen-sprite.png0.53KB0.88KB0.00%
lib/freemius/assets/img/simple-facebook-twitter-widget.png57.51KB10.59KB▼ 81.58%
lib/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
lib/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%