67% social-media-by-lazy-cat-themes

Code Review | Social Media by Lazy Cat Themes

WordPress plugin Social Media by Lazy Cat Themes scored67%from 54 tests.

About plugin

  • Plugin page: social-media-by-l...
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: May 18, 2016
  • Latest release: Oct 30, 2016
  • Number of updates: 38
  • Update frequency: every 26.8 days
  • Top authors: dun_edwards (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,543 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.66MB] [CPU: ▼4.88ms] Passed 4 tests

A check of server-side resources used by Social Media by Lazy Cat Themes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.5933.74 ▼11.71
Dashboard /wp-admin4.00 ▲0.6562.82 ▼4.25
Posts /wp-admin/edit.php4.05 ▲0.6957.81 ▲8.50
Add New Post /wp-admin/post-new.php6.58 ▲0.6991.54 ▼12.07
Media Library /wp-admin/upload.php3.93 ▲0.6945.00 ▲9.41
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins4.0737.92

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 66 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_lct_social_media_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Social Media by Lazy Cat Themes: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲6314.76 ▲0.572.08 ▲0.0345.32 ▲1.98
Dashboard /wp-admin2,225 ▲485.59 ▼0.0885.72 ▼11.2345.70 ▲5.62
Posts /wp-admin/edit.php2,136 ▲362.19 ▲0.1842.82 ▲2.3541.12 ▲3.22
Add New Post /wp-admin/post-new.php1,549 ▲2323.25 ▲0.04688.73 ▲73.8655.05 ▼11.51
Media Library /wp-admin/upload.php1,432 ▲324.20 ▼0.0399.28 ▼7.7549.10 ▲3.07
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins9712.0525.9829.97

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'LCT_Social_Media' does not have a method 'remove_transient_option'
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

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
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/social-media-by-lazy-cat-themes/lct-social-media.php
  • 34× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant LCT_SOCIAL_MEDIA_WIDGETS_DIR - assumed 'LCT_SOCIAL_MEDIA_WIDGETS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-media-by-lazy-cat-themes/lib/widgets/class-lct-widget-loader.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/social-media-by-lazy-cat-themes/lib/vendor/twitteroauth/tests/TokenTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-by-lazy-cat-themes/lib/socialstats/class-lct-follower-counter.php:10
    • > PHP Warning
      require_once(LCT_SOCIAL_MEDIA_WIDGETS_DIRclass-lct-social-media-widget.php): failed to open stream: No such file or directory in wp-content/plugins/social-media-by-lazy-cat-themes/lib/widgets/class-lct-widget-loader.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Config' not found in wp-content/plugins/social-media-by-lazy-cat-themes/lib/vendor/twitteroauth/src/TwitterOAuth.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-by-lazy-cat-themes/lib/class-lct-social-media-requires.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'LCT_Social_Stat' not found in wp-content/plugins/social-media-by-lazy-cat-themes/lib/socialstats/networks/class-lct-youtube-social-stat.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'LCT_Social_Stat' not found in wp-content/plugins/social-media-by-lazy-cat-themes/lib/socialstats/networks/class-lct-google-plus-social-stat.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'LCT_Social_Stat' not found in wp-content/plugins/social-media-by-lazy-cat-themes/lib/socialstats/networks/class-lct-pinterest-social-stat.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-by-lazy-cat-themes/lib/class-lct-schema-organization.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === social-media-by-lazy-cat-themes === )
The official readme.txt is a good inspiration

social-media-by-lazy-cat-themes/lct-social-media.php 77% from 13 tests

The principal PHP file in "Social Media by Lazy Cat Themes" v. 1.1.7 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 230 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("social-media-by-lazy-cat-themes.php" instead of "lct-social-media.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected6,973 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP441,0672,9674,041
CSS313132,145
SVG100655
JavaScript2201046
JSON10034
Markdown27025
YAML10017
XML11010

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity11.37
▷ Minimum class complexity1.00
▷ Maximum class complexity178.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes46
▷ Abstract classes36.52%
▷ Concrete classes4393.48%
▷ Final classes00.00%
Methods305
▷ Static methods5919.34%
▷ Public methods24279.34%
▷ Protected methods3210.49%
▷ Private methods3110.16%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants35
▷ Global constants2777.14%
▷ Class constants822.86%
▷ Public constants8100.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