94% social-parts

Code Review | Social Parts

WordPress plugin Social Parts scored 94% from 54 tests.

About plugin

  • Plugin page: social-parts
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-5.2.1
  • WordPress version: 5.8.1
  • First release: May 31, 2019
  • Latest release: Jul 8, 2019
  • Number of updates: 3
  • Update frequency: every 13.0 days
  • Top authors: socialparts (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 324 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼143.58ms] Passed 4 tests

This is a short check of server-side resources used by Social Parts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1537.02 ▲15.04
Dashboard /wp-admin3.10 ▲0.0446.18 ▼3.52
Posts /wp-admin/edit.php3.21 ▲0.1046.12 ▲2.56
Add New Post /wp-admin/post-new.php5.46 ▲0.0396.50 ▼564.51
Media Library /wp-admin/upload.php3.04 ▲0.0332.43 ▼8.83

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: 1 new table, 1 new option
New tables
wp_social_parts
New WordPress options
social_parts_version

Browser metrics Passed 4 tests

Checking browser requirements for Social Parts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,698 ▲10215.87 ▲0.318.37 ▼0.9548.07 ▼2.04
Dashboard /wp-admin2,974 ▲465.91 ▼0.33138.33 ▼10.53130.33 ▲26.00
Posts /wp-admin/edit.php2,768 ▲292.71 ▼0.0163.23 ▼5.2293.81 ▼2.51
Add New Post /wp-admin/post-new.php1,680 ▲1019.09 ▼0.04415.62 ▲11.09108.17 ▲3.38
Media Library /wp-admin/upload.php1,762 ▼455.00 ▲0.01136.93 ▼12.23128.81 ▲11.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% 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 50% 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
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/social-parts/admin/partials/social-parts-admin-display.php:88
    • > PHP Warning
      Use of undefined constant SOCIAL_PARTS_URL - assumed 'SOCIAL_PARTS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-parts/admin/partials/social-parts-admin-display.php on line 85
    • > PHP Notice
      Undefined variable: social_parts_domain_id in wp-content/plugins/social-parts/admin/partials/social-parts-admin-display.php on line 60
    • > PHP Notice
      Undefined variable: social_parts_domain_id in wp-content/plugins/social-parts/admin/partials/social-parts-admin-display.php on line 82
    • > PHP Notice
      Undefined variable: social_parts_domain_id in wp-content/plugins/social-parts/admin/partials/social-parts-admin-display.php on line 16
    • > PHP Warning
      Use of undefined constant SOCIAL_PARTS_PLUGIN_NAME - assumed 'SOCIAL_PARTS_PLUGIN_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-parts/admin/partials/social-parts-admin-display.php on line 14

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

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

social-parts/social-parts.php Passed 13 tests

The main PHP script in "Social Parts" version 1.0.1 is automatically included on every request by WordPress
80 characters long description:
Try Social Proof to turn your visitors into email subscribers before they leave.

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
Everything looks great! No dangerous files found in this plugin1,382 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
CSS113214784
PHP96754464
JavaScript2140134

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods25
▷ Static methods416.00%
▷ Public methods2184.00%
▷ Protected methods00.00%
▷ Private methods416.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/menu-item-logo.png0.96KB0.46KB▼ 52.24%
admin/images/full-logo.png3.06KB1.74KB▼ 43.05%