89% motion

Code Review | Motion

WordPress plugin Motion scored89%from 54 tests.

About plugin

  • Plugin page: motion
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Oct 22, 2015
  • Latest release: Oct 22, 2015
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: adam1920 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

80+ active /3,268 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.15ms] Passed 4 tests

Analyzing server-side resources used by Motion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0541.53 ▼2.00
Dashboard /wp-admin3.42 ▲0.1248.97 ▼4.98
Posts /wp-admin/edit.php3.53 ▲0.1851.71 ▼3.95
Add New Post /wp-admin/post-new.php6.03 ▲0.1485.23 ▼13.68
Media Library /wp-admin/upload.php3.34 ▲0.1239.50 ▲1.48

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 11 new options
New WordPress options
motion_option_customCSS
motion_option_live
db_upgraded
widget_recent-posts
can_compress_scripts
motion_option_offset
motion_option_mobile
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for Motion
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲15813.43 ▼1.178.86 ▲6.7339.66 ▼6.00
Dashboard /wp-admin2,260 ▲835.55 ▲0.0382.55 ▼18.8570.92 ▲26.30
Posts /wp-admin/edit.php2,162 ▲591.99 ▼0.0134.69 ▼1.5136.65 ▲0.45
Add New Post /wp-admin/post-new.php1,598 ▲7021.07 ▼2.15785.76 ▲100.4030.99 ▼44.73
Media Library /wp-admin/upload.php1,459 ▲564.25 ▲0.02114.85 ▲14.0474.79 ▲28.72

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === motion === )
Please take inspiration from this readme.txt

motion/motion.php 85% from 13 tests

"Motion" version 0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages/")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin2,229 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript8196711,010
Sass23107182591
PHP711193456
CSS25594148
JSON10016
Ruby15138

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods29
▷ Static methods1655.17%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
4 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon-20x20.png0.52KB0.71KB0.00%
images/paypal_donate_button217x50.png15.20KB5.70KB▼ 62.50%
images/yeti239x200.png30.46KB9.90KB▼ 67.49%
images/stars.png1.13KB0.65KB▼ 42.24%