10% social-media-station

Code Review | Social Media Station

WordPress plugin Social Media Station scored10%from 54 tests.

About plugin

  • Plugin page: social-media-station
  • Plugin version: 0.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.1
  • WordPress version: 6.3.1
  • First release: Dec 31, 2022
  • Latest release: Dec 31, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: bahson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /133 total downloads

Benchmarks

Plugin footprint 40% 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
The following installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-includes/cron.php+303
    Illegal offset type

Server metrics [RAM: ▲5.40MB] [CPU: ▼25.52ms] 75% from 4 tests

This is a short check of server-side resources used by Social Media Station
Please fix the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.40MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.39 ▲5.9334.53 ▼6.64
Dashboard /wp-admin9.41 ▲6.1040.63 ▼14.91
Posts /wp-admin/edit.php9.41 ▲6.0544.80 ▼8.59
Add New Post /wp-admin/post-new.php9.41 ▲3.5236.26 ▼71.94
Media Library /wp-admin/upload.php9.41 ▲6.1846.37 ▲9.68
New Social media post /wp-admin/post-new.php?post_type=social_media9.4137.91
Social media /wp-admin/edit.php?post_type=social_media9.4148.09
Freemius Debug [v.2.5.3] /wp-admin/admin.php?page=freemius9.4137.78

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 323 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
fs_gdpr
theysaidso_admin_options
db_upgraded
can_compress_scripts
fs_active_plugins
widget_recent-comments
fs_accounts
fs_debug_mode
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Social Media Station
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲12014.44 ▲0.081.63 ▼0.2633.58 ▼11.11
Dashboard /wp-admin2,281 ▲874.87 ▼0.02104.13 ▼9.1739.75 ▼14.43
Posts /wp-admin/edit.php2,164 ▲642.01 ▲0.0438.50 ▲0.2035.38 ▼3.66
Add New Post /wp-admin/post-new.php1,723 ▲19223.68 ▲0.51593.31 ▼10.4066.05 ▲15.75
Media Library /wp-admin/upload.php1,457 ▲574.26 ▼0.05104.17 ▼9.0385.96 ▲39.90
New Social media post /wp-admin/post-new.php?post_type=social_media1,82617.85925.3243.59
Social media /wp-admin/edit.php?post_type=social_media1,1761.9638.2835.78
Freemius Debug [v.2.5.3] /wp-admin/admin.php?page=freemius1,1121.8429.1332.62

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
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/cron.php+303
    Illegal offset type
  • This plugin does not fully uninstall, leaving 10 options in the database
    • fs_debug_mode
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • fs_active_plugins
    • fs_accounts
    • fs_gdpr
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Warning in wp-includes/cron.php+303
    Illegal offset type

SRP 50% 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
Almost there! Just fix the following items
  • 44× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Exceptions\\FacebookSDKException' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookAuthenticationException.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\PseudoRandomString\\PseudoRandomStringGeneratorInterface' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphUser.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNodeFactory' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphObjectFactory.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\Collection' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphEdge.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\PersistentData\\PersistentDataInterface' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/PersistentData/FacebookMemoryPersistentDataHandler.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphGroup.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\Http\\RequestBodyInterface' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/Http/RequestBodyUrlEncoded.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\Url\\UrlDetectionInterface' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\FacebookResponse' not found in wp-content/plugins/social-media-station/vendor/facebook/graph-sdk/src/Facebook/FacebookBatchResponse.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Social media post scheduling form.), #2 (Social media station configuration form.)
The official readme.txt is a good inspiration

social-media-station/social-media-station.php Passed 13 tests

Analyzing the main PHP file in "Social Media Station" version 0.1.0
47 characters long description:
Manage social media posts on a single platform.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin69,166 lines of code in 268 files:
LanguageFilesBlank linesComment linesLines of code
PHP2229,48123,84439,981
JSON90028,214
JavaScript1169131431
Markdown41120327
JSX3211168
Sass33029
CSS160016

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,089)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity35.76
▷ Minimum class complexity1.00
▷ Maximum class complexity3,089.00
Average method complexity3.66
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces20
Interfaces5
Traits2
Classes137
▷ Abstract classes42.92%
▷ Concrete classes13397.08%
▷ Final classes00.00%
Methods1,917
▷ Static methods24712.88%
▷ Public methods1,45675.95%
▷ Protected methods472.45%
▷ Private methods41421.60%
Functions100
▷ Named functions9393.00%
▷ Anonymous functions77.00%
Constants173
▷ Global constants9957.23%
▷ Class constants7442.77%
▷ Public constants7195.95%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.49MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png139.41KB36.81KB▼ 73.60%
freemius/assets/img/social-media-station.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/banner-700x250.png199.12KB125.81KB▼ 36.82%
assets/screenshot-2.png131.18KB32.46KB▼ 75.26%