78% widget-snapcode

Code Review | Snapcode Widget for Snapchat

WordPress plugin Snapcode Widget for Snapchat scored 78% from 54 tests.

About plugin

  • Plugin page: widget-snapcode
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 5.8.1
  • First release: Mar 4, 2017
  • Latest release: Mar 4, 2017
  • Number of updates: 14
  • Update frequency: every 0.8 days
  • Top authors: riotweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,009 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼140.19ms] Passed 4 tests

Server-side resources used by Snapcode Widget for Snapchat
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1539.21 ▲15.32
Dashboard /wp-admin3.10 ▲0.0453.87 ▲5.94
Posts /wp-admin/edit.php3.15 ▲0.0446.85 ▼1.06
Add New Post /wp-admin/post-new.php5.45 ▲0.0297.87 ▼569.76
Media Library /wp-admin/upload.php3.04 ▲0.0339.05 ▲4.14

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 1 new option
New WordPress options
widget_snapchatwidget

Browser metrics Passed 4 tests

Checking browser requirements for Snapcode Widget for Snapchat
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲9715.91 ▲0.0211.31 ▲1.6454.93 ▲4.92
Dashboard /wp-admin2,970 ▲395.92 ▼0.30145.52 ▼16.38120.51 ▲10.11
Posts /wp-admin/edit.php2,739 ▲32.69 ▲0.0167.76 ▼1.1197.17 ▼2.24
Add New Post /wp-admin/post-new.php1,683 ▲18318.83 ▼0.08396.93 ▲24.11112.90 ▼3.58
Media Library /wp-admin/upload.php1,807 ▼35.02 ▼0.00153.51 ▲2.20122.45 ▼5.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_snapchatwidget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/widget-snapcode/snapchat-widget.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widget-snapcode/widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: snapcode widget, widgets, widget, snap, social media...

widget-snapcode/snapchat-widget.php 92% from 13 tests

The entry point to "Snapcode Widget for Snapchat" version 1.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("widget-snapcode.php" instead of "snapchat-widget.php")

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
No dangerous file extensions were detected136 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24943111
JavaScript18725

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity12.50
▷ Minimum class complexity2.00
▷ Maximum class complexity23.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods222.22%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected