10% social-news-center

Code Review | Social News Center

WordPress plugin Social News Center scored10%from 54 tests.

About plugin

  • Plugin page: social-news-center
  • Plugin version: 0.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Nov 16, 2015
  • Latest release: Jul 11, 2017
  • Number of updates: 23
  • Update frequency: every 26.3 days
  • Top authors: pgowling (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,885 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/social-news-center/includes/htmlwrap.php+116
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.44MB] [CPU: ▼51.69ms] Passed 4 tests

An overview of server-side resources used by Social News Center
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.54 ▼0.927.76 ▼37.59
Dashboard /wp-admin2.56 ▼0.749.16 ▼48.82
Posts /wp-admin/edit.php2.56 ▼0.799.86 ▼33.41
Add New Post /wp-admin/post-new.php2.56 ▼3.328.69 ▼86.95
Media Library /wp-admin/upload.php2.56 ▼0.679.61 ▼24.46

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 187 new files
Database: 3 new tables, 29 new options
New tables
snc_networks
snc_api_usage_stats
snc_user_access
New WordPress options
snc_default_cookie_timeout
snc_twitter_consumer_key
snc_layout_style
snc_posts_per_account_popup
snc_instagram_access_token
db_upgraded
snc_twitter_retweets
snc_posts_total_maximum
snc_instagram_client_secret
snc_twitter_consumer_secret
...

Browser metrics Passed 4 tests

Checking browser requirements for Social News Center
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲18713.88 ▼0.8710.06 ▲7.8442.79 ▼2.95
Dashboard /wp-admin2,238 ▲475.01 ▼0.80107.73 ▲1.7440.38 ▼0.41
Posts /wp-admin/edit.php2,124 ▲352.48 ▲0.4635.22 ▼2.2933.07 ▼0.73
Add New Post /wp-admin/post-new.php1,543 ▲1022.48 ▼0.60682.55 ▲45.2038.03 ▼12.79
Media Library /wp-admin/upload.php1,423 ▲354.42 ▲0.2494.10 ▼4.9144.12 ▼0.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/social-news-center/includes/htmlwrap.php+116
    Array and string offset access syntax with curly braces is deprecated
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/social-news-center/social-news-center.php
  • 35× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphObject' not found in wp-content/plugins/social-news-center/facebook/GraphPage.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/social-news-center/includes/config-wp.php:9
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/social-news-center/twitter/twitteroauth/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/social-news-center/twitter/twitteroauth/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/social-news-center/twitter/twitteroauth/tests/Util/JsonDecoderTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\FacebookRequestException' not found in wp-content/plugins/social-news-center/facebook/FacebookPermissionException.php:30
    • > PHP Warning
      Use of undefined constant WP_DEBUG - assumed 'WP_DEBUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-news-center/includes/config-wp.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\FacebookRequestException' not found in wp-content/plugins/social-news-center/facebook/FacebookAuthorizationException.php:30
    • > PHP Warning
      Use of undefined constant SNC_BASE_PATH - assumed 'SNC_BASE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-news-center/includes/config.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\FacebookSignedRequestFromInputHelper' not found in wp-content/plugins/social-news-center/facebook/FacebookJavaScriptLoginHelper.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\FacebookRequestException' not found in wp-content/plugins/social-news-center/facebook/FacebookThrottleException.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: social networks, social media, display tweets, social news, display photos...

social-news-center/social-news-center.php 92% from 13 tests

"Social News Center" version 0.0.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 286 characters long)

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
There were no executable files found in this plugin8,800 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
PHP631,7024,7417,410
CSS29930670
JavaScript9142329651
JSON10034
Markdown27025
XML11010

PHP code Passed 2 tests

A brief analysis 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.30
Average class complexity6.18
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes48
▷ Abstract classes36.25%
▷ Concrete classes4593.75%
▷ Final classes00.00%
Methods318
▷ Static methods4514.15%
▷ Public methods29291.82%
▷ Protected methods134.09%
▷ Private methods134.09%
Functions84
▷ Named functions8196.43%
▷ Anonymous functions33.57%
Constants45
▷ Global constants3782.22%
▷ Class constants817.78%
▷ Public constants8100.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
99 PNG files occupy 0.21MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon_favorited.png0.57KB0.52KB▼ 8.97%
images/twitter/retweet_on.png0.22KB0.31KB0.00%
images/facebook/FB-f-Logo__blue_57.png1.42KB0.41KB▼ 71.20%
images/twitter/retweet_white.png0.28KB0.23KB▼ 15.79%
images/facebook/FB-f-Logo__blue_50.png1.37KB0.35KB▼ 74.41%