79% mfs-campaigns

Code Review | MFS Campaigns

WordPress plugin MFS Campaigns scored79%from 54 tests.

About plugin

  • Plugin page: mfs-campaigns
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 4, 2013
  • Latest release: Nov 4, 2013
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: Mindfire-Solutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /792 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.64MB] [CPU: ▼18.78ms] Passed 4 tests

Server-side resources used by MFS Campaigns
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0640.48 ▼4.07
Dashboard /wp-admin3.37 ▲0.0650.28 ▲1.76
Posts /wp-admin/edit.php3.42 ▲0.0649.09 ▼2.92
Add New Post /wp-admin/post-new.php3.15 ▼2.7433.86 ▼65.54
Media Library /wp-admin/upload.php3.29 ▲0.0635.42 ▼2.60
Campaigns /wp-admin/edit.php?post_type=campaign3.3338.93
Add New /wp-admin/post-new.php?post_type=campaign3.1535.49
Settings /wp-admin/edit.php?post_type=campaign&page=campaign-settings3.2633.41

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
campaign_enabled
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

MFS Campaigns: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,005 ▲25914.28 ▼0.156.88 ▲5.2347.47 ▲7.29
Dashboard /wp-admin2,240 ▲525.16 ▼0.69101.48 ▼4.0186.03 ▲37.88
Posts /wp-admin/edit.php2,143 ▲512.29 ▲0.2936.33 ▼3.0836.51 ▼0.63
Add New Post /wp-admin/post-new.php1,554 ▲2123.35 ▲0.06749.93 ▲84.5638.14 ▼18.69
Media Library /wp-admin/upload.php1,431 ▲434.43 ▲0.22104.96 ▼6.8272.83 ▲21.46
Campaigns /wp-admin/edit.php?post_type=campaign1,1042.2435.7332.47
Add New /wp-admin/post-new.php?post_type=campaign2,5318.34185.87122.36
Settings /wp-admin/edit.php?post_type=campaign&page=campaign-settings8591.9327.7325.22

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • campaign_enabled
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=campaign
    • > Notice in wp-content/plugins/mfs-campaigns/mfs-campaigns.php+171
    Trying to get property 'ID' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/mfs-campaigns/mfs-campaigns.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: campaign, wordpress campaign plugin, mfs campaign, wp campaign, wordpress campaign

mfs-campaigns/mfs-campaigns.php Passed 13 tests

Analyzing the main PHP file in "MFS Campaigns" version 1.0
114 characters long description:
MFS campaigns plugin lets you create multiple campaigns on your website and display them randomly on your website.

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
No dangerous file extensions were detected437 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS1250199
PHP24819190
JavaScript2272648

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
resources/img/campaign.png0.88KB0.76KB▼ 13.56%