72% snazzy-cacheable-facebook-feed

Code Review | Snazzy Social Media Feed

WordPress plugin Snazzy Social Media Feed scored72%from 54 tests.

About plugin

  • Plugin page: snazzy-cacheable-...
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 23, 2016
  • Latest release: Aug 27, 2019
  • Number of updates: 32
  • Update frequency: every 30.3 days
  • Top authors: snazzyplugins (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /1,835 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.30ms] Passed 4 tests

Analyzing server-side resources used by Snazzy Social Media Feed
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.1346.70 ▼1.91
Dashboard /wp-admin3.71 ▲0.1548.17 ▼7.05
Posts /wp-admin/edit.php3.76 ▲0.0851.90 ▼2.90
Add New Post /wp-admin/post-new.php6.23 ▲0.0890.08 ▼9.33
Media Library /wp-admin/upload.php3.57 ▲0.0838.87 ▼1.15
Snazzy Social Media /wp-admin/options-general.php?page=snazzy-facebook3.6735.55

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_awmi_featured_events
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Snazzy Social Media Feed
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.37 ▼0.441.71 ▼0.3642.05 ▼4.30
Dashboard /wp-admin2,202 ▲255.66 ▼0.0287.86 ▼13.9737.85 ▼10.09
Posts /wp-admin/edit.php2,101 ▲12.04 ▲0.0038.83 ▼1.0137.12 ▲3.80
Add New Post /wp-admin/post-new.php1,548 ▲1723.14 ▼0.08681.33 ▲13.4551.51 ▼3.53
Media Library /wp-admin/upload.php1,398 ▲14.23 ▲0.0297.65 ▼5.3241.81 ▲0.49
Snazzy Social Media /wp-admin/options-general.php?page=snazzy-facebook9812.1026.7031.63

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_awmi_featured_events
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=snazzy-facebook
    • > Notice in wp-content/plugins/snazzy-cacheable-facebook-feed/admin/partials/snazzy-facebook-admin-display.php+155
    Trying to access array offset on value of type bool

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 fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/snazzy-cacheable-facebook-feed/public/partials/snazzy-facebook-public-display.php
    • > /wp-content/plugins/snazzy-cacheable-facebook-feed/functions/save-to-cache.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined index: pluginURL in wp-content/plugins/snazzy-cacheable-facebook-feed/functions/save-to-cache.php on line 70
    • > PHP Notice
      Undefined index: facebookId in wp-content/plugins/snazzy-cacheable-facebook-feed/functions/save-to-cache.php on line 75
    • > PHP Notice
      Undefined index: feedLimit in wp-content/plugins/snazzy-cacheable-facebook-feed/functions/save-to-cache.php on line 74
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/snazzy-cacheable-facebook-feed/admin/widget-facebook-feed.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/snazzy-cacheable-facebook-feed/admin/widget-facebook-feed.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/snazzy-cacheable-facebook-feed/admin/partials/snazzy-facebook-admin-display.php:140
    • > PHP Notice
      Undefined index: feedSize in wp-content/plugins/snazzy-cacheable-facebook-feed/functions/save-to-cache.php on line 73

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: social, widget, free, feed, media...

snazzy-cacheable-facebook-feed/snazzy-facebook.php 77% from 13 tests

"Snazzy Social Media Feed" version 2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 234 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("snazzy-cacheable-facebook-feed.php" instead of "snazzy-facebook.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,664 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP141696051,057
CSS2216389
SVG212202
JavaScript11016

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity3.62
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/empty.png14.65KB0.09KB▼ 99.35%