10% social-media-trifecta

Code Review | Social Media Trifecta

WordPress plugin Social Media Trifecta scored10%from 54 tests.

About plugin

  • Plugin page: social-media-trif...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.4
  • WordPress version: 6.3.1
  • First release: Apr 2, 2016
  • Latest release: Apr 4, 2016
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: ayush.malakar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /530 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/social-media-trifecta/admin_menus/classes/class-trifecta-instagram.php+100
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▲0.00MB] [CPU: ▲1.28ms] Passed 4 tests

Analyzing server-side resources used by Social Media Trifecta
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0044.17 ▲3.80
Dashboard /wp-admin3.31 ▲0.0063.21 ▲9.73
Posts /wp-admin/edit.php3.36 ▲0.0051.48 ▲6.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.49 ▼2.37
Media Library /wp-admin/upload.php3.23 ▲0.0036.58 ▼2.58

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 60 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Social Media Trifecta
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.131.68 ▲0.0240.13 ▼3.20
Dashboard /wp-admin2,209 ▲215.86 ▲0.7996.48 ▼8.5145.14 ▲4.21
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0641.34 ▲3.5036.72 ▲2.25
Add New Post /wp-admin/post-new.php1,544 ▲1123.14 ▲0.01642.43 ▼7.7647.38 ▼10.16
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0296.27 ▼10.6842.08 ▼6.81

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 22× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/social-media-trifecta/Facebook/index.php
    • > /wp-content/plugins/social-media-trifecta/Twitter/lib/twitter-text-php/lib/Twitter/index.php
    • > /wp-content/plugins/social-media-trifecta/Twitter/css/index.php
    • > /wp-content/plugins/social-media-trifecta/Templates/index.php
    • > /wp-content/plugins/social-media-trifecta/admin_menus/classes/index.php
    • > /wp-content/plugins/social-media-trifecta/Facebook/css/index.php
    • > /wp-content/plugins/social-media-trifecta/Instagram/js/index.php
    • > /wp-content/plugins/social-media-trifecta/admin_menus/index.php
    • > /wp-content/plugins/social-media-trifecta/Instagram/index.php
    • > /wp-content/plugins/social-media-trifecta/Instagram/css/index.php
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/social-media-trifecta/Templates/instagram/instagram-default.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-trifecta/Twitter/class-smt-twitter-generator.php:106
    • > PHP Notice
      Undefined variable: instagram_data in wp-content/plugins/social-media-trifecta/Templates/instagram/instagram-developer.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/social-media-trifecta/Templates/twitter/twitter-default.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-trifecta/admin_menus/classes/class-trifecta-facebook.php:170
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/social-media-trifecta/Templates/facebook/facebook-default.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-trifecta/Instagram/class-smt-instagram-generator.php:116
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-trifecta/social-media-trifecta.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-trifecta/Facebook/class-smt-facebook-generator.php:127
    • > PHP Notice
      Undefined variable: facebook_data in wp-content/plugins/social-media-trifecta/Templates/facebook/facebook-developer.php on line 2

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === social-media-trifecta === )
Please take inspiration from this readme.txt

social-media-trifecta/social-media-trifecta.php 92% from 13 tests

"Social Media Trifecta" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin4,949 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
CSS545132,268
PHP215571,2481,909
SVG100655
Markdown123050
JavaScript215041
JSON10026

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity80.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes17.14%
▷ Concrete classes1392.86%
▷ Final classes00.00%
Methods170
▷ Static methods148.24%
▷ Public methods13881.18%
▷ Protected methods74.12%
▷ Private methods2514.71%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants16
▷ Global constants16.25%
▷ Class constants1593.75%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected