Convert API Log Data Into Actionable Information

Featured Imgs 23

You’ve built an API to solve technical problems, but you know that’s just the beginning. In addition to helping developers use it, you need to understand how they use it. You want to measure its performance and popularity and make adjustments based on what you discover.

Maybe some developers are seeing a lot of errors when making API calls or it’s taking too long for them to get to the first “Hello World.” Perhaps the number of developers converting to paying customers is below your expectations. You want to understand the usage of your API and ensure that customers use your API in the long term.

10+ Image Optimization WordPress Plugins

Wp Plugins

A website without images is well, drab. You know, boring. A website with non-optimized images is a complete drag, and it will eat up your precious bandwidth, slow down just about everything and ruin the user experience (UX). Every website owner should strive to provide the best user experience to their visitors at all times. Using […]

The post 10+ Image Optimization WordPress Plugins appeared first on WPExplorer.

Newsletter Glue Closes Free Plugin on WordPress.org

Featured Imgs 26

The creators of Newsletter Glue have removed their free plugin from WordPress.org in favor of focusing on the commercial version. The plugin streamlines the publishing workflow for newsletter authors who also publish to their WordPress sites. It includes blocks and patterns for email templates and subscriber forms. Five months ago the plugin’s authors warned users that they would be closing the free version and would no longer be updating it as of May 1, but the process of removing it was delayed until today.

Co-founder Lesley Sim announced the plugin’s closure on Twitter and shared a few valuable lessons for WordPress product businesses looking to use WordPress.org as a their primary distribution channel.

“We made a bunch of noob mistakes in the way we set up free vs paid,” Sim said. “Which made the customer upgrade flow kind of weird. I think it could’ve worked. We just didn’t set it up right, and it just doesn’t make sense to fix it.”

At the time of closure, the free Newsletter Glue plugin had approximately 200 active installations, which seems low for a growing commercial plugin. This is because the free version got uninstalled when a user upgraded to pro, so it was never a good representation of how many people were using the product. Sim said Newsletter Glue wasn’t growing the free user base and “it was just sitting there like a dead tree stump.” The company had not updated it in over a year.

“We stupidly set it such that when a user upgrades, they install the pro version and the free version automatically uninstalls,” Sim said. “So we lost free active users as a ‘reward’ for new conversions.”

This architectural choice meant that WordPress.org wasn’t bringing the product a significant flow of traffic and prospective upgrades.

“A year ago, we simply didn’t have enough features to make good decisions on what to put in the free versus pro,” Sim said. “So we went from having all our integrations on the free plugin to gating some integrations instead. I think this was a poor decision and led to our install count instantly stagnating. This could have been reversed, so I don’t think this was a key reason. But it was an instigating reason to begin considering removing the plugin from the repo since it was no longer bringing us traffic and installs.”

Despite not finding WordPress.org a good source of traffic for the product, Sim said the decision to close was not easy.

“Here are some things we lost out on:” Sim said. “1) Biggest distribution channel in WP. 2) Easy way for reviewers to check out the plugin for free without having to contact me. 3) Source of credibility (reviews).”

Current users can still use the free plugin but it will not be getting updates anymore. In lieu of a free plugin, Newsletter Glue is offering a test drive option where users can try it on a demo site before purchasing. The company has taken a unique path to becoming a commercial plugin that is fully independently distributed.

“I hate the free to paid user experience on the WP directory with a passion,” Sim said. “We had a full standalone pro plugin so the upgrade flow was really clunky. We’d get users using the free version emailing us saying, ‘I’ve just upgraded, but I don’t see any pro features on my site. What’s wrong?’ I also had some wonderful customers who would upgrade then continue using the free version for over a year, not even realizing they were on the free version.”

By focusing focusing exclusively on promoting the commercial product, the Newsletter Glue team is now free of the burden of supporting customers transitioning from the free version. The trade-off is missing out on exposure on WordPress.org. It’s an approach that works for the company at this stage but may not be suitable to other new products without strong marketing in place.

“Unless you already have experience marketing a plugin from scratch AND you have a good go to market plan, I think the default choice should be to be on the [WordPress] repo,” Sim said. “Just make sure you set up the commercial part of your plugin correctly so that it makes sense.”

Workout Tracking With Your App in the Background

Featured Imgs 23

It can be so frustrating to lose track of a workout because the fitness app has stopped running in the background. It happens when you turn off the screen or have another app in the front to listen to music or watch a video during the workout. Talk about all of your sweat and effort going to waste!

Fitness apps work by recognizing and displaying the user's workout status in real time, using the sensor on the phone or wearable device. They can obtain and display complete workout records to users only if they can keep running in the background. Since most users will turn off the screen, or use other apps during a workout, it has been a must-have feature for fitness apps to keep alive in the background. However, to save battery power, most phones will restrict or even forcibly close apps once they are running in the background, causing the workout data to be incomplete. When building your own fitness app, it's important to keep this limitation in mind.

Neural-Symbolic Regression: Distilling Science from Data

Featured Imgs 23

The universe is noisy and confusing, complex enough to make predictions difficult. Human intelligence and intuition facilitate a basic understanding of some of the activities of the world around us. And they do so well enough to make basic sense of events at the macro space and time scales of the limited perspectives of individuals and small groups. 

The natural philosophers of human prehistory and early history were mostly limited to common sense rationalization and guess and check. The limitations of these methods, especially for things that are just too big or too complex, are readily apparent in the prevalence and influence of superstition and magical thinking. 

How to Easily Add Custom Code in WordPress (Without Breaking Your Site)

Category Image 091

Often while reading WordPress tutorials, you may be asked to add custom code snippets in your theme’s functions.php file or in a site-specific plugin.

The problem is that even the slightest mistake can break your website.

In this article, we will show you an easy way to add custom code in WordPress without breaking your site.

How to easily add custom code in WordPress

The Problem with Custom Code Snippets (And How to Fix It)

Often you’ll find code snippets in WordPress tutorials with instructions to add them into your theme’s functions.php file or a site-specific plugin.

The biggest problem is that even a tiny mistake in the custom code snippet can break your WordPress site and make it inaccessible.

Not to mention, if you update your WordPress theme, then all your customizations get removed.

The other problem is that if you add multiple code snippets in a site-specific plugin, it can become hard to manage the file.

Luckily, there is an easier way for users to add and manage custom code snippets in WordPress.

WPCode is the most popular code snippets plugin used by over 1 million WordPress websites. It makes it easy to add code snippets in WordPress without having to edit your theme’s functions.php file.

WPCode Code Snippets Plugin

WPCode also makes it simple to add tracking codes for Google Analytics, Facebook Pixel, Google AdSense, and more to your site’s header and footer areas.

You’ll never have to worry about breaking your site because the smart code snippet validation helps you prevent common code errors.

In addition, WPCode comes with a built-in snippets library where you can find all of the most popular WordPress code snippets like disable REST API, disable comments, disable Gutenberg, allow SVG file uploads, and much more. This eliminates the need to install separate plugins for each feature request.

The best part is that you can manage all your code snippets from one central screen and add tags to organize them.

With that said, let’s take a look at how to easily add custom code snippets in WordPress with WPCode.

Adding Custom Code Snippets in WordPress

The first thing you need to do is install and activate the WPCode plugin on your website.

For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, the plugin will add a new menu item labeled ‘Code Snippets’ to your WordPress admin bar. Clicking on it will show you a list of all the custom code snippets you have saved on your site.

Since you just installed the plugin, your list will be empty.

Go ahead and click on the ‘Add New’ button to add your first custom code snippet in WordPress.

Click 'Add New' in WPCode to create a new custom snippet

This will bring you to the ‘Add Snippet’ page. Here you can choose a code snippet from the pre-made library or add your custom code.

To add custom code, click on the ‘Use snippet’ button underneath the ‘Add Your Custom Code (New Snippet)’ option.

Add custom code in WPCode

You need to start by entering a title for your custom code snippet. This could be anything that helps you identify the code.

After that, you can copy and paste your code snippet into the code box. Be sure to also select the correct code type from the drop-down menu on the right.

Adding your first code snippet

In the screenshot above, we have added a custom code snippet to remove the WordPress version number from our test site.

function wpb_remove_version() {
return '';
}
add_filter('the_generator', 'wpb_remove_version');

Below the code box, you will see insertion options. There are two main insertion options: Auto Insert and Shortcode (Default).

Choose insertion option for code snippet

If you chose the ‘Auto Insert’ method, the snippet will be automatically inserted and executed on your site.

You can automatically run the snippet only in the WordPress admin area, on the front-end of your site, or everywhere. If you are unsure, then select the default ‘Run snippet everywhere’ option.

With the ‘Shortcode’ method, the snippet is not automatically inserted. Once you save the snippet, you’ll get a shortcode specific to the snippet that you can use anywhere on your site.

When you scroll further down, you will see a ‘Basic info’ area. You can add anything here that helps you understand what this code does, where you found it, and why you are adding it to your website.

Add code description and tags

You can also assign tags to your code snippet. This will help you sort your code snippets by topic and functionality.

The priority field allows you to control the order in which the snippets are executed when you want to display multiple snippets in the same location. By default, all snippets get a priority of 10. If you want a snippet to display earlier than others, simply set the snippet priority to a lower number, like 5.

Lastly, you can use the powerful ‘Smart Conditional Logic’ section to either show or hide auto-inserted snippets based on a set of rules.

Use smart conditional logic to show or hide snippets

For example, you can show code snippets to logged-in users only, load code snippets only on specific page URLs, and more.

When you’re finished choosing options, you can click the ‘Save Snippet’ button in the top-right corner of the screen and toggle the switch from ‘Inactive’ to ‘Active.’

Save and activate code snippet

If you want to save the code snippet and not activate it, then simply click on the ‘Save Snippet’ button.

Once you have saved and activated the code snippet, it will be added to your site automatically, if that’s the insertion method you chose, or displayed as a shortcode.

Handling Errors in Custom Code

Often, if you make a mistake in adding the custom code in your site-specific plugin or theme file, then it would immediately make your site inaccessible.

You would start seeing a syntax error or a 500 internal server error on your site. To fix this you’ll need to manually undo your code using an FTP client.

The neat part about the WPCode plugin is that it will automatically detect a syntax error in the code and immediately deactivate it.

Error handling in your custom code snippet

It will also show you a helpful error message, so you can debug the error.

WPCode’s smart code snippet validation will also detect any errors as you’re adding your custom code.

Smart code snippet validation to find code errors

Hovering over the error will bring up instructions to help you fix it.

Managing Your Custom Code Snippets

WPCode plugin provides an easy user interface to manage your custom code snippets in WordPress.

You can save code snippets without activating them on your site, and then activate or deactivate the snippet at any time you want. It’s also possible to filter code snippets by type and location, and use tags to organize your code snippets easily.

WPCode - WordPress Snippets Organized by Tags

You can also export specific code snippets or bulk export all of them.

Simply go to Code Snippets » Tools and click on the ‘Export’ tab.

Export your custom code snippets

If you’re moving websites to a different server, you can easily import your code snippets to the new site.

Just visit the Code Snippets » Tools » Import page and upload the export file.

Import code snippets with WPCode

We hope this article helped you learn how to easily add custom code in WordPress. Want to experiment with some code snippets on your website? Check out our list of extremely useful tricks for the WordPress functions file, and don’t forget to see our ultimate guide to speeding up your WordPress site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Easily Add Custom Code in WordPress (Without Breaking Your Site) first appeared on WPBeginner.

WooCommerce to Stop Registering Customizer Options in Upcoming 6.9 Release

Set Up Woocommerce

WooCommerce is making a strong push towards getting the Customizer menu out of the admin for those who are using a block theme. In an effort to clean up the admin and eliminate confusion, the plugin will stop registering Customizer options when a block theme is active beginning with version 6.9. This will go into effect with WooCommerce 6.9, which is expected to be released in September 2022. 

The problem is that site owners can get confused by having both the “Edit site” and “Customize” menu links in the admin.

This change is an important one for WooCommerce developers to acknowledge if they are still registering settings within the WooCommerce panel in the Customizer. Developers can opt to use the customize_register action to include Customizer menu items, but continuing to offer Customizer options is not an ideal user experience.

“Subpanels or sections registered within the WooCommerce panel on the Customizer will no longer be accessible since the Customizer links will be removed,” WooCommerce engineer Alba Rincón said in the announcement. “If you’re the developer of a theme or extension that relies on the presence of these you will need to make changes to ensure a smooth transition.”

WooCommerce core developers recommend plugin authors update their products to relocate any Customizer settings to a block, pattern, or the Global Styles menu.

Community developers are also invited to weigh in on a change that may impact developers’ debugging workflows. It is a proposal designed to address the problem of the growing size of the WooCommerce zip archive, which is rapidly approaching a size where it is difficult for some users to update with out timing out. The core team is considering removing JavaScript and CSS source files from releases, but this major change requires community feedback. The discussion will be open on GitHub until August 26th, 2022.

Clojure: Destructuring

558fe5180e0e8fc922d31c23ef84d240

In The Joy of Clojure (TJoC) destructuring is described as a mini-language within Clojure. It's not essential to learn this mini-language; however, as the authors of TJoC point out, destructuring facilitates concise, elegant code.

Making Code More Understandable

One of the scariest things for those who are just now learning how to do some coding is the fact that they have to try to figure out what a seemingly impossible set of rules and structures means for the work that they are trying to do. It is not easy at all, and many people struggle with it in big ways. 

Custom Validation in Mule 4 Using Mule SDK

Featured Imgs 23

Custom Validation in Mule

Validators are operations that validate the Mule Message without changing the message. Validators can produce these effects:

  • If the condition the validator demands is fulfilled, the flow continues, and the Mule Message remains the same.
  • If the condition the validator demands is not fulfilled, an error is thrown.

Today we will be creating a custom validation that will validate whether a currency is valid or not. 

4 Reasons MSPs Should Monitor Their GitHub Footprint

Featured Imgs 23

In recent years, resorting to MSPs has become very popular for companies wanting to accelerate the digitization of their businesses. With this surge in popularity, MSPs are broadening their range of responsibilities and now face the question: how to ensure we can meet our cybersecurity responsibilities?

In this article, we will see why monitoring in real-time code-sharing platforms such as GitHub should be a top priority for any MSP.

Quick Tip: Clear VS Code Cache for Open Files

Category Image 052

If you use VS Code, you might have enabled the setting for re-opening a previously open file next time the app launches. I do. I like that.

Hey, thanks for remembering, buddy! 🤗

But sometimes you really, really don’t want that to happen.

I recently ran into one of those times! I had to reinstall my local copy of this site and, with it, the 3GB+ database that accompanies it. Being a WordPress site and all, I needed to open up the SQL database file to search-and-replace some stuff.

If you’ve ever tried to open a super duper large file in VS Code, then you know you might need to jiggle a few settings that increase the memory limit and all that. The app is super flexible like that. There’s even a nice extension that’ll both increase the memory and perform a search-and-replace on open.

Anyway, that big ol’ database file crashed VS Code several times and I wound up finding another way to go about things. However, VS Code keeps trying to open that file and inevitably crashes even though I nuked the file. And that means I wait for the MacOS beachball of fun to spin around before the app crashes and I can reopen it again for reals.

Well, I finally decided to fix that today and spent a little time searching around. One Stack Overflow thread suggests disabling extensions and increasing the memory limit via the command line. I’m glad that worked for some folks, but I had to keep looking.

Another thread suggests clearing the app’s cache from the command palette.

Nice, but no dice. 🎲

I wound up going with a scorched earth strategy shared by Jie Jenn in a helpful YouTube video. You’ve gotta manually trash the cached files from VS Code. The video walks through it in Windows, but it’s pretty darn similar in MacOS. The VS Code cache is located in your user folder.

Notice that I have the Backups folder highlighted there. Jie removed the files from the CachedData folder, but all that did was trigger a prompt for me to re-install the app. So, I took a risk and deleted what appeared to be a 3GB+ file in Backups. I showed that file the door and VS Code has been happy ever since.

Ask me again in a week and maybe I’ll find out that I really screwed something up. But so far, so good!


Quick Tip: Clear VS Code Cache for Open Files originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.