78% social-media-aggregator

Code Review | Social Media Aggregator

WordPress plugin Social Media Aggregator scored 78% from 54 tests.

About plugin

  • Plugin page: social-media-aggr...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 5.8.1
  • First release: Aug 22, 2014
  • Latest release: Sep 12, 2014
  • Number of updates: 9
  • Update frequency: every 25.0 days
  • Top authors: ryac (77.78%)wesdeboer (33.33%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active / 2,765 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼134.73ms] Passed 4 tests

Server-side resources used by Social Media Aggregator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.11 ▲0.3952.99 ▲29.38
Dashboard /wp-admin3.46 ▲0.4158.47 ▲6.58
Posts /wp-admin/edit.php3.50 ▲0.3957.38 ▲8.20
Add New Post /wp-admin/post-new.php5.75 ▲0.32107.89 ▼557.16
Media Library /wp-admin/upload.php3.34 ▲0.3338.98 ▲3.47
Settings /wp-admin/edit.php?post_type=sa-socialfeed&page=sa-settings3.3140.67
Social Content /wp-admin/edit.php?post_type=sa-socialfeed3.4141.18
Source Type /wp-admin/edit-tags.php?taxonomy=sa_tax_sources&post_type=sa-socialfeed3.3548.57
Options /wp-admin/edit.php?post_type=sa-socialfeed&page=sa-options3.3139.76
Add New /wp-admin/post-new.php?post_type=sa-socialfeed3.5254.22

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 76 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Social Media Aggregator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,764 ▲18215.91 ▲0.4411.40 ▲3.4547.97 ▼7.28
Dashboard /wp-admin3,020 ▲865.84 ▼0.09147.19 ▲5.37122.16 ▼1.23
Posts /wp-admin/edit.php2,789 ▲502.69 ▼0.0170.15 ▲6.1289.99 ▼3.12
Add New Post /wp-admin/post-new.php1,715 ▲3218.66 ▼0.09387.58 ▲8.66112.11 ▼0.87
Media Library /wp-admin/upload.php1,857 ▲475.03 ▲0.00148.14 ▼6.16127.34 ▲9.72
Settings /wp-admin/edit.php?post_type=sa-socialfeed&page=sa-settings1,1492.3660.06100.42
Social Content /wp-admin/edit.php?post_type=sa-socialfeed1,4622.6471.5276.85
Source Type /wp-admin/edit-tags.php?taxonomy=sa_tax_sources&post_type=sa-socialfeed2,1192.4168.3088.11
Options /wp-admin/edit.php?post_type=sa-socialfeed&page=sa-options1,1072.0954.7476.68
Add New /wp-admin/post-new.php?post_type=sa-socialfeed3,0459.17242.52151.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/social-media-aggregator/vendor/facebook/php-sdk/examples/with_js_sdk.php
    • > /wp-content/plugins/social-media-aggregator/vendor/dg/rss-php/load-rss.php
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Tests/UserTest.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Instagram\et\\ClientInterface' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Instagram/Net/CurlClient.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Instagram\\User' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Instagram/CurrentUser.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Instagram\\Collection\\MediaCollection' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Instagram/Collection/LikedMediaCollection.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Instagram\\Core\\BaseObjectAbstract' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Instagram/User.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Tests/TagTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Instagram\\Collection\\CollectionAbstract' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Instagram/Collection/MediaSearchCollection.php:16
    • > PHP Fatal error
      Uncaught OAuthException: Error validating application. Application has been deleted. thrown in wp-content/plugins/social-media-aggregator/vendor/facebook/php-sdk/src/base_facebook.php on line 1294
    • > PHP Fatal error
      Uncaught Error: Class 'Instagram\\Collection\\CollectionAbstract' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Instagram/Collection/UserCollection.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Instagram\\Core\\BaseObjectAbstract' not found in wp-content/plugins/social-media-aggregator/vendor/php-instagram-api/php-instagram-api/Instagram/Location.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === social-media-aggregator === )
The official readme.txt is a good inspiration

social-media-aggregator/im-social-aggregator.php 92% from 13 tests

The primary PHP file in "Social Media Aggregator" version 1.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("social-media-aggregator.php" instead of "im-social-aggregator.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/social-media-aggregator/vendor/facebook/php-sdk/src/fb_ca_chain_bundle.crt
6,582 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP591,3263,0605,933
Markdown41220279
JSON500269
JavaScript22058
CSS11943

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity8.25
▷ Minimum class complexity1.00
▷ Maximum class complexity125.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces7
Interfaces2
Traits0
Classes61
▷ Abstract classes34.92%
▷ Concrete classes5895.08%
▷ Final classes00.00%
Methods555
▷ Static methods244.32%
▷ Public methods46784.14%
▷ Protected methods7814.05%
▷ Private methods101.80%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants14
▷ Global constants17.14%
▷ Class constants1392.86%
▷ Public constants13100.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
There are no PNG files in this plugin