83% em-social-media

Code Review | EM Social Media

WordPress plugin EM Social Media scored83%from 54 tests.

About plugin

  • Plugin page: em-social-media
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.3
  • WordPress version: 6.3.1
  • First release: Feb 7, 2017
  • Latest release: Mar 13, 2017
  • Number of updates: 6
  • Update frequency: every 5.5 days
  • Top authors: erikdmitchell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /850 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.42MB] [CPU: ▼1.80ms] Passed 4 tests

Analyzing server-side resources used by EM Social Media
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4251.52 ▲12.95
Dashboard /wp-admin3.73 ▲0.3852.19 ▼11.47
Posts /wp-admin/edit.php3.84 ▲0.4849.66 ▲0.61
Add New Post /wp-admin/post-new.php6.33 ▲0.44100.82 ▲0.56
Media Library /wp-admin/upload.php3.65 ▲0.4237.35 ▲3.12
Social Media /wp-admin/options-general.php?page=em-social-media3.7636.68

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for EM Social Media
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2913.17 ▼1.204.41 ▲2.4542.01 ▼0.53
Dashboard /wp-admin2,217 ▲465.88 ▲0.1392.47 ▼16.1544.58 ▼3.27
Posts /wp-admin/edit.php2,123 ▲202.36 ▲0.3535.08 ▼5.0131.89 ▼6.03
Add New Post /wp-admin/post-new.php1,548 ▲1123.37 ▲0.16611.61 ▼34.7933.04 ▼21.27
Media Library /wp-admin/upload.php1,425 ▲284.49 ▲0.2997.66 ▼11.9044.73 ▼0.90
Social Media /wp-admin/options-general.php?page=em-social-media4,8762.9248.1832.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_emsm_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/em-social-media/functions.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/em-social-media/admin/admin.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/em-social-media/admin/pages/settings.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/em-social-media/widget.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/em-social-media/shortcode.php:16

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: "erikdmitchell@gmail.com"
You can take inspiration from this readme.txt

em-social-media/em-social-media.php 85% from 13 tests

This is the main PHP file of "EM Social Media" version 0.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin3,075 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
SVG1002,671
PHP675139228
JavaScript12956111
CSS30365

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.50
▷ Minimum class complexity4.00
▷ Maximum class complexity7.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods1292.31%
▷ Protected methods17.69%
▷ Private methods00.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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