10% digital-media-combined

Code Review | Social Media Control Centre

WordPress plugin Social Media Control Centre scored10%from 54 tests.

About plugin

  • Plugin page: digital-media-com...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-5.0.3
  • WordPress version: 6.3.1
  • First release: May 30, 2017
  • Latest release: Jan 31, 2019
  • Number of updates: 44
  • Update frequency: every 13.9 days
  • Top authors: esolsteve (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,909 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/digital-media-combined/includes/module.php+162
    include(wp-content/plugins/digital-media-combined/users/languages/en_US.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.01MB] [CPU: ▼11.01ms] Passed 4 tests

Analyzing server-side resources used by Social Media Control Centre
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0246.85 ▲3.69
Dashboard /wp-admin3.32 ▼0.0260.00 ▼7.30
Posts /wp-admin/edit.php3.37 ▲0.0246.26 ▼11.41
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.71 ▼27.02
Media Library /wp-admin/upload.php3.24 ▲0.0240.30 ▲1.70

Server storage [IO: ▲13.38MB] [DB: ▲0.02MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/digital-media-combined/" and "wp-content/uploads/"
    • (new file) wp-content/logs/newsletter/.empty
Filesystem: 869 new files
Database: 4 new tables, 25 new options
New tables
wp_newsletter_stats
wp_newsletter
wp_newsletter_emails
wp_newsletter_sent
New WordPress options
db_upgraded
newsletter_logger_secret
newsletter_users
newsletter_users_version
newsletter_main_version
newsletter_emails
newsletter_profile
newsletter_statistics_version
widget_theysaidso_widget
newsletter_subscription_version
...

Browser metrics Passed 4 tests

Social Media Control Centre: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.26 ▼0.161.68 ▼0.3745.15 ▼1.90
Dashboard /wp-admin2,195 ▲275.59 ▼0.0088.59 ▼2.7744.08 ▼12.36
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0134.95 ▲0.1136.06 ▼1.16
Add New Post /wp-admin/post-new.php1,528 ▼023.28 ▲0.29677.28 ▼11.8755.23 ▼3.52
Media Library /wp-admin/upload.php1,397 ▼34.19 ▲0.03103.32 ▼21.8345.27 ▼3.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_newsletter_emails
    • wp_newsletter_sent
    • wp_newsletter_stats
    • wp_newsletter
  • Zombie WordPress options detected upon uninstall: 25 options
    • newsletter_logger_secret
    • theysaidso_admin_options
    • newsletter_main
    • newsletter_main_smtp
    • widget_recent-posts
    • newsletter_lock_version
    • widget_theysaidso_widget
    • digital-media-combined
    • can_compress_scripts
    • newsletter_profile
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 13× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/digital-media-combined/emails/themes/default/social_main.php
    • > /wp-content/plugins/digital-media-combined/emails/tnp-composer/blocks/content-02-heading.block.php
    • > /wp-content/plugins/digital-media-combined/emails/tnp-composer/blocks/content-05-image.block.php
    • > /wp-content/plugins/digital-media-combined/users/index.php
    • > /wp-content/plugins/digital-media-combined/subscription/email-alternative.php
    • > /wp-content/plugins/digital-media-combined/emails/tnp-composer/blocks/footer-02-canspam.block.php
    • > /wp-content/plugins/digital-media-combined/emails/tnp-composer/blocks/content-03-text.block.php
    • > /wp-content/plugins/digital-media-combined/emails/tnp-composer/blocks/header-01-header.block.php
    • > /wp-content/plugins/digital-media-combined/emails/tnp-composer/blocks/footer-01-footer.block.php
    • > /wp-content/plugins/digital-media-combined/emails/themes/default/social.php
  • 86× 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/digital-media-combined/php-graph/tests/FileUpload/FacebookFileTest.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Tests\\HttpClients\\AbstractTestHttpClient' not found in wp-content/plugins/digital-media-combined/php-graph/tests/HttpClients/FacebookStreamHttpClientTest.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/digital-media-combined/php-graph/tests/Http/RequestBodyMultipartTest.php:29
    • > PHP Warning
      include(): Failed opening 'WP_PLUGIN_DIR/newsletter/emails/themes/default/social-options.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/digital-media-combined/emails/themes/simple/theme-options.php on line 1
    • > PHP Warning
      Use of undefined constant DMC_INCLUDES_DIR - assumed 'DMC_INCLUDES_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/digital-media-combined/emails/tnp-composer/blocks/content-07-twocols.block.php on line 2
    • > PHP Warning
      Use of undefined constant DMC_LIST_MAX - assumed 'DMC_LIST_MAX' (this will throw an Error in a future version of PHP) in wp-content/plugins/digital-media-combined/subscription/languages/profile-en_US.php on line 33
    • > PHP Warning
      include(WP_PLUGIN_DIR/newsletter/emails/themes/default/social-options.php): failed to open stream: No such file or directory in wp-content/plugins/digital-media-combined/emails/themes/simple/theme-options.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/digital-media-combined/php-graph/tests/Exceptions/FacebookResponseExceptionTest.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/digital-media-combined/php-graph/tests/Http/RequestUrlEncodedTest.php:28
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/digital-media-combined/dmc.php on line 53

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (94 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Contributors: Plugin contributors field is missing
Please take inspiration from this readme.txt

digital-media-combined/dmc.php 92% from 13 tests

Analyzing the main PHP file in "Social Media Control Centre" version 1.0.6
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("digital-media-combined.php" instead of "dmc.php")

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
No dangerous file extensions were detected39,003 lines of code in 659 files:
LanguageFilesBlank linesComment linesLines of code
PHP1693,7923,64418,572
CSS351,1202599,220
JavaScript4261,6546896,881
SVG3102,494
HTML16148131,363
Markdown4650234
PO File266135151
JSON10041
YAML27025
XML10022

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.27
Average class complexity13.55
▷ Minimum class complexity1.00
▷ Maximum class complexity337.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes78
▷ Abstract classes22.56%
▷ Concrete classes7697.44%
▷ Final classes00.00%
Methods596
▷ Static methods345.70%
▷ Public methods58798.49%
▷ Protected methods10.17%
▷ Private methods81.34%
Functions48
▷ Named functions4185.42%
▷ Anonymous functions714.58%
Constants40
▷ Global constants2972.50%
▷ Class constants1127.50%
▷ Public constants11100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
98 PNG files occupy 1.43MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
emails/themes/default/images/facebook.png0.65KB0.40KB▼ 38.91%
css/jquery-ui/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
images/popup/bg.png0.30KB0.51KB0.00%
images/menu-icon.png0.85KB0.97KB0.00%
emails/themes/cta-2015/images/vimeo.png1.79KB0.65KB▼ 63.81%