73% newmoji

Code Review | Newmoji

WordPress plugin Newmoji scored73%from 54 tests.

About plugin

  • Plugin page: newmoji
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2.24+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.3-5.5.3
  • WordPress version: 6.3.1
  • First release: Dec 14, 2020
  • Latest release: Dec 14, 2020
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: benjaminguv001 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /484 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.32MB] [CPU: ▼19.61ms] Passed 4 tests

A check of server-side resources used by Newmoji
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.24 ▲0.7838.65 ▼2.49
Dashboard /wp-admin3.31 ▲0.0142.22 ▼9.10
Posts /wp-admin/edit.php3.36 ▲0.0148.64 ▼4.88
Add New Post /wp-admin/post-new.php4.60 ▼1.2839.49 ▼61.98
Media Library /wp-admin/upload.php3.24 ▲0.0136.11 ▼1.78

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 26 new files
Database: 1 new table, 7 new options
New tables
wp_newmoji_votes
New WordPress options
my_db_version
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Newmoji
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.36 ▲0.081.69 ▼0.2649.76 ▲3.06
Dashboard /wp-admin2,211 ▲315.58 ▼0.1283.43 ▼6.0636.17 ▼1.42
Posts /wp-admin/edit.php2,119 ▲192.01 ▼0.0337.73 ▼0.6231.74 ▼4.08
Add New Post /wp-admin/post-new.php1,405 ▼12320.61 ▼2.13541.40 ▼88.6475.67 ▲15.49
Media Library /wp-admin/upload.php1,419 ▲194.19 ▲0.03100.98 ▼8.7143.38 ▼3.10

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_newmoji_votes
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • my_db_version
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant NWMJ_NEWMOJI__PLUGIN_URL - assumed 'NWMJ_NEWMOJI__PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/newmoji/includes/newmoji-acp-page.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/newmoji/newmoji-plugin.php:18
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/newmoji/includes/newmoji-installer.php on line 4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/newmoji/includes/newmoji-acp-page.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_charset_collate() on null in wp-content/plugins/newmoji/includes/newmoji-installer.php:6
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/newmoji/includes/newmoji-acp-page.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function prepare() on null in wp-content/plugins/newmoji/includes/newmoji-acp-page.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: Add descriptions for screenshots #1, #2, #3 in newmoji/assets to your readme.txt
The official readme.txt is a good inspiration

newmoji/newmoji-plugin.php 85% from 13 tests

The primary PHP file in "Newmoji" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("newmoji.php" instead of "newmoji-plugin.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,932 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP72484761,801
CSS116274
JavaScript130757

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity137.50
▷ Minimum class complexity4.00
▷ Maximum class complexity271.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods93
▷ Static methods00.00%
▷ Public methods2526.88%
▷ Protected methods6873.12%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants93
▷ Global constants22.15%
▷ Class constants9197.85%
▷ Public constants91100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 2.64MB with 1.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png248.36KB131.98KB▼ 46.86%
assets/emojis/feliz.png27.99KB11.68KB▼ 58.26%
assets/banner-1544x500-rtl.png981.41KB532.58KB▼ 45.73%
assets/emojis/enojo.png25.77KB10.80KB▼ 58.07%
assets/banner-772x250-rtl.png248.36KB131.98KB▼ 46.86%