Hot-Cold Data Separation: What, Why, and How?

Featured Imgs 26

Apparently, hot-cold data separation is hot now. But first of all:

What Is Hot/Cold Data?

In simple terms, hot data is the frequently accessed data, while cold data is the one you seldom visit but still need. Normally in data analytics, data is "hot" when it is new and gets "colder" and "colder" as time goes by. 

12 Ways To Monetize Your WordPress Blog

Fotolia Subscription Monthly 4685447 Xl Stock
In today’s world, content creation has become a popular medium for self-expression and sharing opinions or expertise. However, many creators devote significant time and effort to their blog posts without earning much in return. Unfortunately, crafting an article requires a considerable amount of time and dedication. Over time, you may have encountered numerous blogs that […]

How to Prevent Changes to Plugins, Themes, and WordPress Core Files

Category Image 091

This is a common question I get from folks in the WordPress community. How can I “lock things down” and prevent any changes to plugins, themes, and WordPress core files. For example, how to prevent any themes and/or plugins from being updated or deleted, and how to prevent any new plugins from being installed. This is useful for certain projects where it’s necessary to lock a website to a static version. Fortunately, WordPress makes this super easy with a couple of PHP constants. Let’s take a quick look..

Contents

Prevent Changes via File Editor

Did you know that WordPress provides a Plugin File Editor and Theme File Editor in the WP Admin Area. You can find them:

  • Under the Appearance menu ▸ Theme File Editor
  • Under the Plugins menu ▸ Plugin File Editor

These tools enable admins to make changes to any plugin or theme files. Huge convenience for those that need it. For those that don’t, you can disable any changes via the file editors by adding the following line to your site’s wp-config.php file, which resides in the root WordPress directory:

// disable file changes via plugin and theme editors
define('DISALLOW_FILE_EDIT', true);

Once this line is included in the site’s configuration file, all file-editing via the Admin Area will be disabled. No menu items, no editing, nada. It’s another layer of security that effectively minimizes your site’s attack surface, so sensitive files cannot be modified by any user, including admins. This helps to protect against any changes that could compromise or crash your site.

Note: As explained at WordPress.org, disabling the file editors via DISALLOW_FILE_EDIT constant may affect any plugins that check for sufficient capabilities using current_user_can('edit_plugins'). Plugins should check if the constant is set, and if so display an appropriate error message.

Prevent All Changes via Admin Area

While the previous technique disables changes to plugins and themes via the file editors, this next technique prevents all changes to any files from inside the Admin Area. This includes:

  • Updating, deleting, installing plugins
  • Updating, deleting, installing themes
  • Updating the WordPress core files

It also includes changes made via the plugin and theme file editors. Basically this technique staticizes a site to its current version. So if that sounds like you, here is the magic code to lock it down:

// disable all changes to all files via admin area
define('DISALLOW_FILE_MODS', true);

Once this line is included in the site’s configuration file, all changes (installing, updating, deleting) to plugins and themes will be disabled. Note that the above line also disables updates to the WordPress core files, so trying to update WordPress via Dashboard ▸ Updates will not work.

Of course, it always is possible for changes to be made directly on the server via SFTP or similar method. But any file changes from within the Admin Area will be disabled completely.

Note: As mentioned, the above line disables all changes from anywhere within the Admin Area, including the file editors. So you do not need to set both DISALLOW_FILE_MODS and DISALLOW_FILE_EDIT. Just including DISALLOW_FILE_MODS takes care of everything.
Note: Be careful when adding DISALLOW_FILE_MODS to your site’s wp-config.php file. WordPress needs to be able to make changes in order to keep plugins, themes, and core files current via updates. So only disable changes if you are 100% certain that you don’t want any updates on your WordPress site.

“What are effective digital marketing strategies for small businesses?”

Featured Imgs 20

Answer:

SEO Optimization:Enhance website visibility with suitable keywords.
Social Media Engagement: Utilize platforms to connect and drive traffic.
Content Marketing: Generate valuable content to attract and inform.
Email Campaigns: Build relationships through personalized emails.
PPC Advertising: Targeted ads for immediate website traffic.
Mobile-Friendly Approach: Perfect for smartphones and analyze data for continuous improvement.

Decoding Duolingo: Returning to the Office, Enabling First-Time Managers, and More

Featured Imgs 26

Remote, hybrid, or in-office? Opinions are divided on what has quickly become one of the most controversial topics in tech: Should we return to the office, and if so, how and when?

On this week’s episode of Dev Interrupted, we sit down with Duolingo’s Sr. Director of Engineering, Fabio Lessa, to discuss how to successfully transition your engineering org back to the office — and why Duolingo has done it so successfully. [Hint: it all starts with culture.]

The npm tea party

Featured Imgs 26

#​700 — August 15, 2024

Read on the Web

👋 Wow, issue 700! We’re back after a week away. Technically I’m still on vacation, but I didn’t want to leave you in the lurch for too long.. 😉
__
Peter Cooper, your editor

JavaScript Weekly

ECMAScript Safe Assignment Operator Proposal — We often feature ECMAScript proposals that are in their later stages, but how about a brand new one you could get involved with? This one proposes an interesting additional bit of language syntax (?=) that returns a [error, value] tuple from an assignment.

Arthur Fiorette

Crafting a 13KB Game: The Story of Space Huggers — We always love Frank’s dives into how he produces neat JavaScript experiments and, in this case, a complete game in just 13KB — and if it inspires you, the latest js13kGames game development competition has just started.

Frank Force

WorkOS: The Modern Identity Platform for B2B SaaS — WorkOS is a modern identity platform for B2B SaaS, offering flexible and easy-to-use APIs to integrate SSO, SCIM, and RBAC in minutes instead of months. It’s trusted by hundreds of high-growth startups such as Perplexity, Vercel, Drata, and Webflow.

WorkOS sponsor

Google’s Angular Lead Sees Convergence in JavaScript Frameworks“When picking a framework, don’t overthink it. It will end up being the same technology anyway with a different facade.” Minko Gechev talks about leading the way in converging Google’s Angular and Wiz frameworks.

Loraine Lawson (The New Stack)

Announcing Official Puppeteer Support for Firefox — As of version 23, Google’s originally Chrome-only Puppeteer browser automation library now has first-class support for Firefox too.

Mozilla Hacks

IN BRIEF:

⭐ If you’ve wondered why so many new npm packages are spam these days, it may be because of ‘Tea’. Though not the drinking kind..

Brendan Eich has expressed his support for the currently stage 1 Decimal draft proposal for bringing a more precise decimal number representation to JavaScript.

There’s an early technical preview of React Native WebGPU. William Candillon shows it off in ▶️ this 9-minute screencast.

RELEASES:

jQuery UI 1.14.0 – The legacy effects and widgets library reduces support for older browsers.

Madge 8.0 – Create graphs of module dependencies.

React Native 0.75, Angular 18.2, Bun 1.1.23, ESLint 9.9

📒 Articles & Tutorials

Patterns for Memory Efficient DOM Manipulation — Marc shares a solid look at the best practices to employ in order to avoid excess memory usage when managing/updating the DOM, all with a hope to make your apps faster. A good overview of the core principles behind DOM manipulation and optimization.

Marc Grabanski

‘How I Won $2,750 using JavaScript, AI, and a Can of WD-40’ — This is far from a technical JavaScript article, but it’s a fun story, involves some code and statistics, and ultimately might make you laugh.

Dave Kiss

Breakpoints and console.log Is the Past, Time Travel Is the Future — 15x faster JavaScript debugging than with breakpoints and console.log, supports Vitest, jest, node:test, and more. Huge changes are coming in Wallaby 2.0! Stay tuned. 🚀

Wallaby Team sponsor

Common Causes of Memory Leaks in JavaScript — Filled with basic examples oriented around V8-based runtimes like Node.js and Deno.

Trevor Indrek Lasn

Learn Web Components — If you’re looking to scrub on your Web Components know-how, this road map should prove useful. It’s a collection of good third party articles covering a wide range of knowledge.

Andrico Karoulla

A Tale of Evading JavaScript Anti-Debugging Techniques — When debugging code written by a third party, there could be some traps thrown in your way to prevent your usual debugging techniques. What to do? Revisiting a popular article from 2023.

Veritas

Fine-Grained Reactivity in Svelte 5 — Taking a close look at Svelte’s new so-called fine-grained reactivity.

Adam Rackis

📄 Tips for Using React Testing Library to Write Unit Tests Pavan Policherla

📄 45 VS Code Shortcuts for Boosting Your Productivity Shahed Nasser

🛠 Code & Tools

Volta 2.0: Install and Run JavaScript Tools Quickly — A long-standing Rust powered tool for installing and switching JavaScript related tools (like Node, TypeScript, Yarn, etc.) … “no matter the package manager, Node runtime, or OS.” GitHub repo.

Volta

Floating UI: Positioning for Tooltips, Popovers, Dropdowns, etc. — A library to create ‘floating’ elements such as tooltips, popovers, and dropdowns. Essentially a next-gen Popper which it now officially succeeds.

atomiks

😘 Kiss Bugs Goodbye — Get 80% automated E2E web and mobile app coverage in under four months with QA Wolf
. With QA cycles complete in minutes (not days), bugs don’t stand a chance. Schedule a demo.

QA Wolf sponsor

React Figma: Use Components as a Source for Figma Designs — A lot of folks use Figma to mock up designs for their React components, but what about the other way around? Use React components as a source for your designs in Figma! GitHub repo.

Ilya Lesik

Ky 1.6 – Simple HTTP client based upon Fetch for browsers, Node & Deno.

True Myth 8.0 – Safe, idiomatic null and error handling in TypeScript with Maybe and Result types.

Protobuf-ES 2.0 – Fully compliant Protobuf implementation for JS/TS.

🕹️ Kontra 10.0 – Lightweight gaming micro-library, optimized for js13kGames.

React Tooltip 5.28 – A tooltip component, surprisingly. (Demo.)

express-validator 7.2 – Express.js middleware for validator.js.

jscodeshift 17.0 – JavaScript codemod toolkit from Facebook.

🌍 Turf.js 7.1 – Modular geospatial analysis engine.

Marked 14.0 – Fast Markdown compiler / parser.