71% spritesfeed

Code Review | SpritesFeed

WordPress plugin SpritesFeed scored 71% from 54 tests.

About plugin

  • Plugin page: spritesfeed
  • Plugin version: 0.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.3
  • WordPress version: 6.3.1
  • First release: Feb 22, 2018
  • Latest release: Mar 17, 2018
  • Number of updates: 66
  • Update frequency: every 0.4 days
  • Top authors: sprites (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 746 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.50MB] [CPU: ▼2.63ms] Passed 4 tests

This is a short check of server-side resources used by SpritesFeed
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5244.09 ▼1.44
Dashboard /wp-admin3.94 ▲0.6449.04 ▲3.16
Posts /wp-admin/edit.php4.01 ▲0.6649.13 ▲0.22
Add New Post /wp-admin/post-new.php6.10 ▲0.2184.18 ▼10.81
Media Library /wp-admin/upload.php3.86 ▲0.6337.16 ▲1.53
Facebook /wp-admin/admin.php?page=sfs-feed-fb-settings3.8538.71
Twitter /wp-admin/admin.php?page=sfs-feed-twitter-settings3.8535.22
Instagram /wp-admin/admin.php?page=sprites-feed-insta-settings3.8535.29
Youtube /wp-admin/admin.php?page=sfs-feed-yt-settings3.8534.43
Flickr /wp-admin/admin.php?page=sfs-feed-flickr-settings3.8535.33
Settings /wp-admin/admin.php?page=sfs-feed3.8634.01

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 7,582 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
sfs-feed

Browser metrics Passed 4 tests

SpritesFeed: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲14513.24 ▼1.142.04 ▲0.2439.64 ▼1.74
Dashboard /wp-admin2,268 ▲774.89 ▼0.00109.12 ▲8.4441.08 ▼5.43
Posts /wp-admin/edit.php2,151 ▲622.05 ▲0.0140.29 ▲0.1834.87 ▼1.68
Add New Post /wp-admin/post-new.php1,558 ▲2223.35 ▲0.04658.90 ▲51.5564.77 ▲17.71
Media Library /wp-admin/upload.php1,450 ▲684.24 ▼0.01104.11 ▲8.9044.65 ▲2.89
Facebook /wp-admin/admin.php?page=sfs-feed-fb-settings9852.0628.1331.36
Twitter /wp-admin/admin.php?page=sfs-feed-twitter-settings9552.0726.3828.05
Instagram /wp-admin/admin.php?page=sprites-feed-insta-settings9572.0622.8228.21
Youtube /wp-admin/admin.php?page=sfs-feed-yt-settings9532.0624.6231.03
Flickr /wp-admin/admin.php?page=sfs-feed-flickr-settings9472.0625.4130.86
Settings /wp-admin/admin.php?page=sfs-feed1,0162.0622.8831.18

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • sfs-feed
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sfs-feed
    • > Notice in wp-content/plugins/spritesfeed/modules/instagram_access.php+40
    Trying to access array offset on value of type bool
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sfs-feed-yt-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/spritesfeed/modules/import.php+48
    json_encode() expects parameter 2 to be int, string given
    • > GET request to /wp-admin/admin.php?page=sfs-feed-yt-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/spritesfeed/vendor/google/apiclient/src/Google/Service/Resource.php+291
    implode(): Passing glue string after array is deprecated. Swap the parameters
    • > GET request to /wp-admin/admin.php?page=sfs-feed-flickr-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/spritesfeed/includes/functions.php+376
    Undefined index: photosets
    • > GET request to /wp-admin/admin.php?page=sfs-feed-flickr-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/spritesfeed/includes/functions.php+376
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=sfs-feed-flickr-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/spritesfeed/includes/functions.php+376
    array_reverse() expects parameter 1 to be array, null given

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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/spritesfeed/vendor/j7mbo/twitter-api-php/index.php
  • 4095× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/Devprojects/TosesCheckRequest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/Webmasters/UrlCrawlErrorsCountsQueryResponse.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/Devprojects/UiCustomizationSection.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/DeploymentManager/OperationError.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/Iam/Resource/ProjectsServiceAccountsKeys.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/Dfareporting/Recipient.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/CloudTasks/RenewLeaseRequest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/ServiceUser/SystemParameterRule.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/Doubleclicksearch/Report.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/spritesfeed/vendor/google/apiclient-services/src/Google/Service/Compute/OperationsScopedList.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === spritesfeed === )
You can take inspiration from this readme.txt

spritesfeed/sprites-social-feed.php 77% from 13 tests

"SpritesFeed" version 0.3.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 166 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("spritesfeed.php" instead of "sprites-social-feed.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected400,327 lines of code in 7,546 files:
LanguageFilesBlank linesComment linesLines of code
PHP7,46424,025231,931393,814
Markdown321,45004,716
JSON19001,423
JavaScript9204131
Sass1060116
XML53068
YAML312047
make1409
CSS2002
SVG1001

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity1.81
▷ Minimum class complexity1.00
▷ Maximum class complexity606.00
Average method complexity1.11
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces50
Interfaces30
Traits6
Classes7,435
▷ Abstract classes110.15%
▷ Concrete classes7,42499.85%
▷ Final classes90.12%
Methods54,695
▷ Static methods1550.28%
▷ Public methods54,19999.09%
▷ Protected methods2310.42%
▷ Private methods2650.48%
Functions352
▷ Named functions16847.73%
▷ Anonymous functions18452.27%
Constants765
▷ Global constants303.92%
▷ Class constants73596.08%
▷ Public constants735100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/j7mbo/twitter-api-php/test/img.png18.88KB10.40KB▼ 44.90%
assets/icon-128x128.png6.81KB3.12KB▼ 54.17%
assets/icon-256x256.png17.46KB5.87KB▼ 66.39%