InMotion Hosting Support Center https://www.inmotionhosting.com/support/ Web Hosting Support & Tutorials Fri, 17 Jan 2025 19:52:09 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 https://www.inmotionhosting.com/support/wp-content/uploads/2019/09/imh_favicon_hd.png InMotion Hosting Support Center https://www.inmotionhosting.com/support/ 32 32 162937910 How to Update DNS Records for MailChannels https://www.inmotionhosting.com/support/email/mailchannels/mailchannels-dns-records/ https://www.inmotionhosting.com/support/email/mailchannels/mailchannels-dns-records/#respond Wed, 18 Dec 2024 17:06:27 +0000 https://www.inmotionhosting.com/support/?p=128957 Read More >]]> How to Update DNS Records for MailChannels

If you’re managing your DNS elsewhere (your nameservers are not pointed to InMotion Hosting nameservers) and need to update your SPF and TXT records for MailChannels on our Shared, WordPress and Reseller Servers, this guide will walk you through the process step-by-step for some popular domain registrars.

What Are SPF and TXT Records?

  • SPF Record: Helps prevent email spoofing by specifying which mail servers are allowed to send emails on your domain’s behalf.
  • TXT Record: A flexible DNS record used for various purposes, like email validation and verification.

For MailChannels, you’ll need to update your SPF record and add a new TXT record to ensure smooth email delivery.

General Information Before You Begin

SPF Record Update:

  1. Locate your current SPF record in your DNS settings. It will start with something like:
    v=spf1
  2. Add the following to your existing SPF record:
    include:relay.mailchannels.net
  3. Do not remove any existing entries unless specifically instructed. For example, if your SPF record currently looks like this:
    “v=spf1 +a +mx +ip4:192.168.1.1 include:smtp.servconfig.com ~all”
    Update it to:
    "v=spf1 +a +mx +ip4:192.168.1.1 include:smtp.servconfig.com include:relay.mailchannels.net ~all"
  4. Save the updated record.

TXT Record Addition:

In addition to updating your SPF record, you’ll need to add the following TXT record:

Record Name: _mailchannels.domain.com  

Record Value: v=mc1 auth=inmotionhosting  

** Replace domain.com with your actual domain name.

How to Update DNS Records at Popular Registrars

General Steps for Updating SPF Records:

GoDaddy

  1. Log into your GoDaddy Domain Portfolio.
  2. Go to DNS.
  3. Locate your current TXT record containing the SPF entry.
  4. Edit the record:
    • Add include:relay.mailchannels.net to the existing record, keeping the rest intact.
  5. Save your changes.

For more information, see GoDaddy Manage DNS Records.

Squarespace Domains

  1. Log into Squarespace.
  2. Select your domain and go to DNS Settings.
  3. Locate your current TXT record containing the SPF entry.
  4. Edit the record:
    • Add include:relay.mailchannels.net to the existing SPF entry.
  5. Save the updated record.

For more information, see Squarespace Adding DNS records to your domain.

Namecheap

  1. Log in to your Namecheap account.
  2. Go to Domain List > Manage > Advanced DNS.
  3. Find your existing TXT record with the SPF entry.
  4. Edit the record:
    • Add include:relay.mailchannels.net to the existing SPF record.
  5. Save your changes.

For more information, see Namecheap How do I add TXT/SPF/DKIM/DMARC records for my domain?

Bluehost

  1. Log in to your Bluehost account.
  2. Navigate to Domains > Advanced Tools > Advanced DNS Records.
  3. Locate the TXT record with the SPF entry.
  4. Edit the record:
    • Add include:relay.mailchannels.net to the SPF record.
  5. Save the updated record.

For more information, see Bluehost DNS Management.

HostGator

  1. Log in to your HostGator account.
  2. Go to your domain’s Advanced Tools section.
  3. Click Manage beside Advanced DNS Records.
  4. Find your existing TXT record with the SPF entry.
  5. Edit the record:
    • Add include:relay.mailchannels.net to the SPF record.
  6. Save your changes.

For more information, see Making DNS Changes to the Domain Bought from HostGator.

Cloudflare

  1. Log in to your Cloudflare account.
  2. Go to DNS > Records.
  3. Locate your TXT record with the SPF entry.
  4. Edit the record:
    • Add include:relay.mailchannels.net to the SPF record.
  5. Save the changes.

For more information, see Cloudflare Manage DNS records.

Dynadot

  1. Log in to your Dynadot account.
  2. Navigate to My Domains > Manage Domains
  3. Check the box next to your domain.
  4. Click the Action button and choose DNS Settings from the list.
  5. Locate the TXT record containing the SPF entry.
  6. Edit the record:
    • Add include:relay.mailchannels.net to the SPF record.
  7. Save the updated record.

For more information, see Dynadot How do I set up DNS for my domain?

Name.com

  1. Log in to your Name.com account.
  2. Navigate to MY DOMAINS.
  3. Click on the desired domain.
  4. Click Manage DNS Records.
  5. Find your current TXT record with the SPF entry.
  6. Edit the record:
    • Add include:relay.mailchannels.net to the existing SPF record.
  7. Save your changes.

For more information, see Name.com Adding DNS records and templates.

IONOS

  1. Log in to your IONOS account.
  2. Navigate to Domains & SSL.
  3. Find your domain, click the gear symbol under Actions and select DNS.
  4. Edit the record:
    • Add include:relay.mailchannels.net to the SPF record.
  5. Save the updated record.

For more information, see IONOS Managing TXT Records.

AWS Route 53

  1. Log in to the AWS Management Console.
  2. Navigate to Route 53 > Hosted Zones.
  3. Locate the TXT record with the SPF entry.
  4. Edit the record:
    • Add include:relay.mailchannels.net to the existing SPF record.
  5. Save the changes.

For more information, see Amazon Route 53 Editing records.

Adding the TXT Record for MailChannels

In addition to updating your SPF record, you’ll need to add the following TXT record:

  • Record Name: _mailchannels.domain.com
  • Record Value: v=mc1 auth=inmotionhosting

** Replace domain.com with your actual domain name.

Follow the same process above to access the DNS settings for your domain and add this new TXT record.

Conclusion

Following these steps ensures your DNS is properly configured for MailChannels on our Shared, WordPress and Reseller servers, improving email deliverability and security. If you encounter issues or have questions, our support team is here to help!

]]>
https://www.inmotionhosting.com/support/email/mailchannels/mailchannels-dns-records/feed/ 0 128957
PHP 8.4 Released https://www.inmotionhosting.com/support/news/php-8-4/ https://www.inmotionhosting.com/support/news/php-8-4/#respond Thu, 12 Dec 2024 18:20:48 +0000 https://www.inmotionhosting.com/support/?p=128944 Read More >]]> Featured image with text PHP 8.4 Released

PHP 8.4 was released November 21, 2024. As of this writing, you can use PHP 8.4 on cPanel VPS environments and Dedicated servers by enabling the package in EasyApache. PHP 8.4 will be added to shared servers after a brief period of testing by InMotion’s Engineering team.

As of January 17, 2025, PHP 8.4 is now available on all shared hosting plans. At this time, IonCube Loader is not yet available for 8.4.

What’s new in PHP 8.4?

HTML 5 Compatibility 

One of the largest improvements is to the \DOMDocument library, which in previous versions was almost compatible with HTML 4. While HTML 5 has been around for over 16 years, PHP still relied on a shoehorn method of using LIBXML and quiet errors to parse most tags outside of the most basic HTML tags.

In PHP 8.4, the new \Dom\HTMLDocument object allows parsing of all HTML5-compliant tags, and because it’s using the new \Dom\ namespace, remains fully backward-compatible with the old \DOMDocument objects. This means developers can continue to use older code that works, but take advantage of the new features as they develop new products.

Property Hooks

Property Hooks will be a boon to developers, allowing them to skip a lot of the basic “boilerplate” code that was previously needed when creating new classes and objects.

Take for example the following class from the PHP Foundation announcement, which contains a few private members:

//PHP < 8.4
class Locale
{
    private string $languageCode;
    private string $countryCode;

    public function __construct(string $languageCode, string $countryCode)
    {
        $this->setLanguageCode($languageCode);
        $this->setCountryCode($countryCode);
    }

    public function getLanguageCode(): string
    {
        return $this->languageCode;
    }

    public function setLanguageCode(string $languageCode): void
    {
        $this->languageCode = $languageCode;
    }

    public function getCountryCode(): string
    {
        return $this->countryCode;
    }

    public function setCountryCode(string $countryCode): void
    {
        $this->countryCode = strtoupper($countryCode);
    }

    public function setCombinedCode(string $combinedCode): void
    {
        [$languageCode, $countryCode] = explode('_', $combinedCode, 2);

        $this->setLanguageCode($languageCode);
        $this->setCountryCode($countryCode);
    }

    public function getCombinedCode(): string
    {
        return \sprintf("%s_%s", $this->languageCode, $this->countryCode);
    }
}

$brazilianPortuguese = new Locale('pt', 'br');
var_dump($brazilianPortuguese->getCountryCode()); // BR
var_dump($brazilianPortuguese->getCombinedCode()); // pt_BR

In this example, the developer has had to write explicit getter and setter functions for each of the member variables. In PHP 8.4, however, it is much easier:

//PHP 8.4
class Locale
{
    public string $languageCode;

    public string $countryCode
    {
        set (string $countryCode) {
            $this->countryCode = strtoupper($countryCode);
        }
    }

    public string $combinedCode
    {
        get => \sprintf("%s_%s", $this->languageCode, $this->countryCode);
        set (string $value) {
            [$this->languageCode, $this->countryCode] = explode('_', $value, 2);
        }
    }

    public function __construct(string $languageCode, string $countryCode)
    {
        $this->languageCode = $languageCode;
        $this->countryCode = $countryCode;
    }
}

$brazilianPortuguese = new Locale('pt', 'br');
var_dump($brazilianPortuguese->countryCode); // BR
var_dump($brazilianPortuguese->combinedCode); // pt_BR

Invoke New Class Methods without Parentheses

In previous versions of PHP, if you wanted to invoke a method of a new class on the same line, the class declaration had to be wrapped in parentheses, like so:

$member = (new ExampleClass($argument))->getMember();

Now, this is more convenient with the new syntax:

$member = new ExampleClass($argument)->getMember();

Implement Your Own Deprecations With the #[\Deprecated] Attribute

You can now use PHP’s built-in deprecation mechanism to alert developers using your code of new ways to accomplish deprecated methods. This will create automatic debug output, similar to deprecations in PHP core.

class MyClass
{
	#[\Deprecated(
		message: "Doing it wrong, use MyClass::newMethod() instead",
		since: "8.4",
	)]
public function oldMethod(): string
{
		return $oldWay;
	}

	public function newMethod(): string
	{
		return $newWay;
	}
}

New Array Functions and More

New functions, including array_find(), array_find_key(), array_any(), and array_all() have been introduced to avoid having to write your own searching functions. There are many other new features, be sure to check out the PHP Official Release announcement here.

PHP 8.4 Availability on your InMotion Hosting Server

PHP 8.4 is already available on VPS accounts using cPanel and CWP. Users with root access can use EasyApache for cPanel to install the new version. CWP administrators can install PHP 8.4 using these instructions.

Our system administrators are currently evaluating the new version for inclusion on shared servers, and it will be available in the near future.

]]>
https://www.inmotionhosting.com/support/news/php-8-4/feed/ 0 128944
What is MailChannels and How it Benefits You https://www.inmotionhosting.com/support/email/mailchannels/what-is-mailchannels/ https://www.inmotionhosting.com/support/email/mailchannels/what-is-mailchannels/#comments Tue, 03 Dec 2024 21:43:29 +0000 https://www.inmotionhosting.com/support/?p=128907 Read More >]]> What is MailChannels? - Hero image

Roughly 45% of email traffic is considered spam. Meanwhile, businesses fight hard to get their legitimate emails through filters. MailChannels is a top-notch email security service that helps with this problem by implementing effective outbound filtering.

Web hosts like InMotion Hosting use it to help customers with secure email delivery. This article dives into the benefits and why we choose it to provide reliable email service for our customers.

What is MailChannels?

MailChannels is a key SMTP relay and email security service. This turnkey service makes email delivery better for web hosts and their customers by managing outbound email.

How Does MailChannels Work?

MailChannels Outbound Filtering automatically scans and delivers all outgoing emails sent from InMotion Hosting servers. Using advanced algorithms, it analyzes email patterns and content to detect and block potential spam, phishing, and other malicious messages. When the system flags an email message as harmful, it will filter it out before it leaves our network. 

By identifying and filtering spam, MailChannels helps prevent blacklisting. Thus, increasing your deliverability and improving overall email security. This protects your email reputation and ensures that legitimate emails reach their recipients.

Here’s why we trust MailChannels:

  • It helps us stop spammers and identifies hacked accounts within our network.
  • It improves delivery rates for our customers.
  • It ensures your email communications remain secure and trustworthy.

Why MailChannels is Important for Your Email Delivery

When your business depends on email to communicate with customers, having reliable email delivery is essential. MailChannels works behind the scenes to improve your email’s performance by:

  • Detecting unusual email patterns that could indicate spammers or hacking attempts.
  • Protecting your sender reputation by preventing outbound spam.
  • Avoiding IP blacklisting, which keeps your email traffic flowing smoothly.

You can rest assured that your emails are safeguarded and optimized for delivery.

Key Features and Benefits of MailChannels for You

FeatureHow it WorksCustomer Benefits
Outbound Email FilteringBlocks potential spam-like emails before they leave your mailbox.Protects your business’s IP reputation and prevents blacklisting.
SMTP Relay ServiceIntegrates seamlessly with InMotion Hosting’s email systems.Boosts email delivery rates with zero setup by you.
Real-Time AnalyticsGives InMotion Hosting’s system admins instant insights into email traffic and issues.Enables quick response to deliverability issues, ensuring your communications are uninterrupted.
Monitoring for Compromised AccountsDetects, blocks, and notifies our staff of suspicious email activity.Keeps your accounts safe while maintaining your email reputation.

How MailChannels Helps Your Business

  1. Protects Your Brand.
    MailChannels helps InMotion Hosting reduce the risk of email blacklisting, which can impact your domain’s credibility. The outbound filtering tool identifies potentially problematic messages before they’re sent. This means fewer issues with IP reputation and better standing with major email providers like Gmail, Yahoo, and Hotmail.
  2. Improves Email Delivery.
    With MailChannels’ SMTP relay service, your business emails are more likely to land in the right inboxes. Thus, helping you maintain critical customer connections.
  3. Keeps You Secure.
    Outbound filtering proactively finds and blocks spam, phishing, and other malicious emails. MailChannels keeps your email environment safe from malicious activity by monitoring hacked accounts and flagging issues in real time.
  4. 24/7 Monitoring and Real-Time Insights.
    MailChannels constantly monitors email traffic so we can take action and resolve any delivery issues fast. Real-time insights and activity logging let our support teams easily investigate delivery problems or unusual activity. This ensures transparency and quick support when you need it.
  5. Minimized Impact of Compromised Accounts.
    If a user account gets compromised and begins sending spam, MailChannels immediately intervenes, blocking the outgoing email. This prevents hacked email accounts from affecting other users on our platform.

Whether you’re sending marketing emails, transactional updates, or customer support responses, MailChannels handles every message with care.

Why InMotion Hosting Uses MailChannels

At InMotion Hosting, we’re always looking for ways to give our customers the best possible experience. MailChannels enables us to:

  • Identify spammers and hacked accounts early.
  • Resolve email deliverability issues faster.
  • Ensure our customers’ emails are delivered securely and reliably.

Comparing MailChannels vs SpamExperts

Here’s how MailChannels stands out from the alternatives:

FeatureMailChannelsSpamExperts
Ease of UseSimple setup, user-friendly interface.Effective but harder to configure.
IntegrationAdapts easily to different hosting setups.Requires more customization.
TechnologyInvests in R&D to ensure its tech evolves with new threats and email standards.Investment is limited to maintenance with more false positives.
AffordabilityFlexible pricing for all business sizes.Varies depending on usage.

How to Start Using MailChannels

If you’re an InMotion Hosting customer in our Amsterdam data center, you already enjoy MailChannels’ filtering technology. Shared Hosting plans already run this service in the background. No extra setup is required on your end. Simply continue using your email as usual. If you ever experience any issues with email delivery or need help, our support team is here to assist.

InMotion Hosting is rolling out MailChannels in phases, and will be available to all customers in early 2025.

Conclusion

With MailChannels, we help you maintain your IP reputation, boost delivery rates, and secure your email environment—all while giving you peace of mind that your business communications are protected.

Have questions? Reach out to our support team anytime—we’re here to help!

FAQ

Is MailChannels a legitimate service?

Yes, it is trusted by many businesses. Hosting providers like InMotion Hosting use it to improve our customers’ delivery rates.

Why is maintaining IP reputation important for email delivery?

A reputable IP address helps emails get delivered. Conversely, a bad one might get blocked, which can seriously impact your credibility and ability to communicate via email.

Is MailChannels free with my hosting plan?

Yes, this service is free with any Shared Hosting plan with no setup or activation required. 

What happens if my email is flagged as spam? 

If an email you send is flagged as spam, it’s filtered out and doesn’t leave our network. Contact our support team if you believe your email was incorrectly flagged.

Does MailChannels affect my incoming emails? 

No. Since it focuses on outbound spam filtering, this service does not affect your incoming emails.

Can I see my email-sending activity?

Our support team can access detailed logs of your email activity and can help investigate any issues you may encounter.

]]>
https://www.inmotionhosting.com/support/email/mailchannels/what-is-mailchannels/feed/ 1 128907
How to Access the MailChannels Dashboard from cPanel https://www.inmotionhosting.com/support/email/mailchannels/access-mailchannels/ https://www.inmotionhosting.com/support/email/mailchannels/access-mailchannels/#respond Thu, 14 Nov 2024 19:40:29 +0000 https://www.inmotionhosting.com/support/?p=128874 Read More >]]> How to Access the MailChannels Dashboard

If your hosting plan includes MailChannels, you can access the MailChannels Dashboard directly from your cPanel account. This guide will walk you through the steps to view and manage your email activity, check deliverability, and monitor email issues.

What is the MailChannels Dashboard?

The MailChannels Dashboard provides tools and insights for managing your incoming email activity. With the dashboard, you can:

  • Reduce the amount of spam in your inbox
  • Block harmful messages that may contain phishing or malware
  • Ensure only legitimate emails reach your inbox

Steps to Access MailChannels Inbound Filtering from cPanel

  1. Log into cPanel.
  2. Once logged in, scroll down to the Email section of your cPanel dashboard.
  3. Click on the MailChannels icon.

    MailChannels icon
  4. Click on the Login button next to the desired domain.

    MailChannels Login
  5. You’ll be redirected to a page where you can manage your inbound filtering settings. Here, you can view mail logs, block senders, whitelist trusted senders, adjust spam filter actions, and review quarantined emails if they are available.

    MailChannels Dashboard

Troubleshooting Tips

Can’t find the MailChannels icon?
If you don’t see the MailChannels option in cPanel, your hosting plan may not include inbound filtering. Contact InMotion Hosting Support to confirm the details of your plan.

Having trouble with spam settings?
If you’re still receiving spam emails, double-check your filter settings. If issues persist, contact our support team for assistance.

]]>
https://www.inmotionhosting.com/support/email/mailchannels/access-mailchannels/feed/ 0 128874
New Features, Twenty Twenty Five Theme Released with WordPress 6.7 https://www.inmotionhosting.com/support/edu/wordpress/wp-releases/wordpress-6-7-release/ https://www.inmotionhosting.com/support/edu/wordpress/wp-releases/wordpress-6-7-release/#respond Tue, 12 Nov 2024 21:41:00 +0000 https://www.inmotionhosting.com/support/?p=128839 Read More >]]>

WordPress 6.7, “Rollins” is released as of November 12, 2024.

This release includes a ton of improvements to the WordPress Block Editor, under-the-hood improvements for Developers to increase performance and interoperability, and incremental changes toward the ultimate goal of enabling a collaborative editing process natively within the WordPress Dashboard.

Twenty Twenty Five, a New Default Theme for Bloggers

Editing the Blog Template in Twenty Twenty Five

The Twenty Twenty Five theme shows off the full capability of the new Site Editor tool. With 9 different built-in styles, 9 color palettes, and 8 typography options, you can mix-and-match to fit your site’s style and make it unique.

The style, palette, and typography options in Twenty Twenty Five

Templates

The theme’s real power comes in the numerous templates available for each content type. Choose dynamic styles for your blog posts page, pages and posts, search results, archives and more.

Choosing templates for content types including Archives, Blog Home, and Search Page in Twenty Twenty Five

Block Patterns

At least 125 block patterns are included in the new theme. Choose patterns from categories like Banners, Calls-to-Action, Galleries, Testimonials and more. These new patterns introduce full page-builder capabilities into the Block editor, giving stiff competition to page builder plugins that have dominated the WordPress landscape for the past years.

Showing off over 125 block patterns included with Twenty Twenty Five

Zoom Out for a Bird’s Eye View of Your Content

While editing pages and posts, a new “Zoom Out” control is introduced so you can get a better view of how your full content coheres together. 

While in zoomed-out view, you can still use the in-editor controls to rearrange your blocks, insert new block patterns, and even “Shuffle” your blocks to rearrange them if you’re feeling lucky.

Zoom out to see more of your page in WordPress 6.7

Better Support for Apple Devices and Images

WordPress 6.7 will include support for the HEIC image format, common on iPhones, iPads, and other Apple devices.

While this image format does not yet have wide adoption in browsers other than Safari, you’ll be able to upload HEIC images directly to the WordPress Media Library and automatically convert them to JPEG. This feature does require server-side support from the iMagick Library, and you can check if your hosting supports it in the Site Health – Info – Media Handling section.

Check Site Health to see if your server supports HEIC images

Improved Query Loop Block

The Query Loop block was introduced way back in WordPress 5.8, but it’s undergone a total overhaul in the new release. The block is meant to be a miniature “blogroll” element, showing a list of Posts or Pages, Custom Post Types, or other content based on user-configurable settings.

The new Query Loop Block is much easier to configure for non-developer users, allowing you to choose from among several Block Patterns and customize “Filters” to show only certain taxonomies or keywords in your block.

The query loop block with content filters showing, including Taxonomies, Authors, and Keywords

Numerous Improvements for Developers

Overall, WordPress 6.7 includes 445 enhancements, 464 Bug Fixes, and 55 Accessibility Improvements.

Notable improvements for Developers include new updates to the Interactivity API and HTML API. Additionally there are numerous improvements to internationalization and language translation.

Plugin Authors will have the new ability to register new templates without relying on complicated filters to interact with users’ themes. This will improve interoperability of plugins with themes so that eventually, plugin and themes won’t have to be designed specifically to account for each others’ usage.

…And all that Jazz

According to tradition, major WordPress releases are named for Jazz Musicians. This release is named in honor of Sonny Rollins, the influential tenor saxophonist whose standards include “St. Thomas” and “Oleo.”

Say goodbye to slow loading times and hello to high-performance websites with our new WordPress VPS Hosting plans. Experience 40x faster WordPress page load speeds on purpose-built servers that guarantee 99.99% uptime.

check markHigh-Performance VPS check markFully-Managed Support check markFree SSL & Dedicated IP check markAdvanced Server Caching

Managed WordPress

]]>
https://www.inmotionhosting.com/support/edu/wordpress/wp-releases/wordpress-6-7-release/feed/ 0 128839
Step-by-Step Guide to Installing React (Updated for 2024) https://www.inmotionhosting.com/support/edu/next-js/install-react/ https://www.inmotionhosting.com/support/edu/next-js/install-react/#respond Fri, 08 Nov 2024 18:48:31 +0000 https://www.inmotionhosting.com/support/?p=128800 Read More >]]> Installing React - Step By Step Guide

React is a popular JavaScript library for building user interfaces, especially single-page applications where dynamic content updates are essential. This guide will walk you through the updated steps to install React using the latest tools like Vite and Next.js and explain why you should use a framework tailored to your needs.

What Is React?

React, developed by Facebook, is a powerful library that makes building interactive and reusable user interface components easier. Its component-based architecture allows developers to create complex UIs by breaking them into smaller, manageable parts. It is widely used for creating single-page applications (SPAs) that update efficiently without full-page reloads.

Why Use React?

  • Component-based: Simplifies UI creation with reusable components.
  • Fast rendering: Optimizes performance through the virtual DOM.
  • Rich ecosystem: Supported by a strong community and a wide range of libraries.

What You Will Need

Before you begin, make sure you have:

  • Node.js: This includes Node Package Manager (NPM), which is necessary for installing React.
  • A code editor: Visual Studio Code (VS Code) is a popular choice.

You can check if Node.js is installed by running the following command in your terminal:

node -v

If Node.js isn’t installed, download and install it from the official Node.js website.

We recommend sticking to a VPS Hosting plan or a Dedicated Server, allowing you to install additional software.

Secure VPS HostingEnjoy high-performance, lightning-fast servers with increased security and maximum up-time with our Secure VPS Hosting!

check markLinux VPS check markcPanel or Control Web Panel check markScalable check markWebsite Migration Assistance

Linux VPS Hosting

Step-by-Step Guide to Installing React

You may still come across tutorials or guides that recommend Create React App (CRA) as a starting point for React projects. However, it is important to note that CRA was deprecated in 2023 due to its outdated build processes and limited capabilities compared to modern tools. Using frameworks like Vite, Next.js, or Remix is now encouraged for new projects.

Step 1: Create a React Application Using Vite

Vite is now a popular choice for React projects due to its fast build times and modern development experience. To create a React app using Vite, follow these steps:

Run the following command in your terminal:

npm create vite@latest my-react-app --template react

Explanation

  • npm create vite@latest initializes a new Vite project.
  • my-react-app is the name of your project, which you can replace with any name you like.
  • --template react sets up the project specifically for React.

Step 2: Navigate to Your Project Directory

Move into your project folder:

cd my-react-app

Step 3: Install Dependencies

Install all necessary project dependencies:

npm install

Step 4: Start the React Application

Start the development server to see your application running locally:

npm run dev

This command opens your React app in your default browser at http://localhost:5173/ (or a different port if 5173 is in use). You should see the default Vite + React welcome page, indicating your setup is complete.

Step 5: Explore the Project Structure

The Vite project structure will look similar to this:

my-react-app/
├── node_modules/
├── public/
   └── index.html
├── src/
   ├── App.css
   ├── App.jsx
   ├── main.jsx
   └── index.css
├── package.json
└── README.md

Key Folders/Files:

  • src/: Contains your React components and main code.
  • public/: Holds static files such as index.html.
  • package.json: Lists dependencies and scripts for your project.

Step 6: Modify Your First Component

Open App.jsx in your code editor and replace the default content with:

function App() {
  return (
    <div>
      <h1>Hello, React with Vite!</h1>
      <p>Welcome to your first React app using Vite.</p>
    </div>
  );
}

export default App;

Save your changes, and your browser will automatically refresh to display the updated content.

Best Practices for Using React

  • Use functional components and hooks: Modern React development favors functional components with hooks (useState, useEffect) for cleaner, more readable code.
  • Keep components small and modular: Design components to focus on a single responsibility.
  • Maintain a clear folder structure: Organize components into subfolders as your app grows.

Choosing the Right React Framework and Build Tools

When deciding how to set up a new React project, it’s crucial to choose the right tool based on your project needs. Here’s an overview of some frameworks and why you might use them, inspired by React’s official recommendations:

  • Vite: Build tool that is ideal for simple, fast setups and development with React. It provides an optimized development experience and quick hot reloading.
  • Next.js: A full-featured framework for building React applications with server-side rendering, static site generation, and API routes. Use this if you need more advanced routing and server capabilities.
  • Remix: Focuses on full-stack web development with a strong emphasis on progressive enhancement and server-side rendering. Consider this for applications that need more robust server interactions.

Each of these frameworks and tools offers a modern, optimized way to start and build React applications with better performance and scalability compared to the now-deprecated CRA.

Conclusion

With the deprecation of Create React App, modern tools like Vite and Next.js provide a more efficient and feature-rich environment for React development. By following this guide, you’ve set up a React app using Vite and learned the essentials for starting your journey in building React applications. Explore these frameworks to find the best fit for your project’s requirements and take your React skills to the next level.

For more tutorials and resources on React, check out our support articles.

]]>
https://www.inmotionhosting.com/support/edu/next-js/install-react/feed/ 0 128800
How to Use Controllers in Laravel https://www.inmotionhosting.com/support/edu/laravel/how-to-use-controllers-in-laravel/ https://www.inmotionhosting.com/support/edu/laravel/how-to-use-controllers-in-laravel/#respond Wed, 21 Aug 2024 20:50:35 +0000 https://www.inmotionhosting.com/support/?p=128620 Read More >]]> How to Use Controllers in Laravel

Laravel is a powerful PHP framework that offers a clean and expressive syntax for web development. Controllers play a critical role in Laravel by handling the logic of your application, responding to user actions, and returning appropriate responses. In this guide, we’ll explore how to effectively use controllers in Laravel, from creating them to using them in your routes.

What are Controllers in Laravel

Controllers in Laravel are classes that handle the logic behind incoming requests and provide the necessary responses. They are typically stored in the app/Http/Controllers directory. Controllers can group related request-handling logic into a single class, making your code more organized and easier to maintain.

Creating a Controller

Laravel provides a simple way to generate controllers using the Artisan command-line tool. To create a new controller, use the following command:

php artisan make:controller MyController

This command creates a new file named MyController.php in the app/Http/Controllers directory. The new controller file will look something like this:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class MyController extends Controller
{
    //
}

You can now add methods to this class to handle various routes

Defining Methods in a Controller

Each method in a controller corresponds to a specific route or action in your application. For instance, if you want to handle a GET request to show a list of products, you could define a method like this:

public function index()
{
    $products = Product::all();
    return view('products.index', compact('products'));
}

This index method fetches all products from the database and returns a view named products.index.

Routing to Controller Methods

To direct traffic to a specific controller method, you need to define it in your routes/web.php file:

use App\Http\Controllers\MyController;

Route::get('/products', [MyController::class, 'index']);

This route definition means that when a user visits /products, the index method of MyController will be executed.

Resource Controllers

Laravel also offers a convenient way to handle CRUD (Create, Read, Update, Delete) operations through resource controllers. You can create a resource controller using the following command:

php artisan make:controller ProductController --resource

A resource controller comes with predefined methods for the common CRUD actions:

  • index – Show all items
  • create – Show form to create a new item
  • store – Handle the saving of a new item
  • show – Show a single item
  • edit – Show form to edit an existing item
  • update – Handle the updating of an item
  • destroy – Delete an item

You can register all routes for these actions with a single line in your routes/web.php file:

Route::resource('products', ProductController::class);

This automatically creates routes for all CRUD operations associated with the ProductController.

Middleware in Controllers

Middleware in Laravel provides a way to filter HTTP requests before they reach your controllers. You can assign middleware to a controller method or the entire controller:

class MyController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }

    public function index()
    {
        // This method is protected by the 'auth' middleware
    }
}

This ensures that only authenticated users can access the index method.

Dependency Injection in Controllers

Laravel’s service container makes it easy to manage dependencies and inject them into your controller methods:

public function show(ProductRepository $repository, $id)
{
    $product = $repository->find($id);
    return view('products.show', compact('product'));
}

In this example, ProductRepository is automatically resolved by the service container and injected into the show method.

Handling Form Requests

Laravel also allows you to validate and process form requests using custom FormRequest classes. You can create a form request class using Artisan:

php artisan make:request StoreProductRequest

This class can be used in a controller method to handle validation:

use App\Http\Requests\StoreProductRequest;

public function store(StoreProductRequest $request)
{
    // Validation is already done by StoreProductRequest
    $validated = $request->validated();

    Product::create($validated);

    return redirect()->route('products.index');
}

Returning Responses

Laravel controllers allow you to return various types of responses:

  • Views: Render a Blade template using the view helper.
  • JSON: Return a JSON response using the response()->json() method.
  • Redirects: Redirect users to a different page using redirect()->route() or redirect()->back().

Example:

public function store(StoreProductRequest $request)
{
    // Save the product
    Product::create($request->validated());

    // Return a JSON response
    return response()->json(['message' => 'Product created successfully']);
}

Using API Controllers

Laravel provides a simple way to build API controllers using the apiResource method, which is similar to resource but optimized for APIs:

Route::apiResource('products', ProductController::class);

API controllers don’t include routes for create or edit, as these operations typically involve forms and are irrelevant in API contexts.

Best Practices

  • Single Responsibility: Ensure each controller method has a single responsibility, making your code easier to maintain.
  • RESTful Structure: Follow RESTful conventions for method names and routes.
  • Use Resource Controllers: Use resource controllers to minimize repetitive code for CRUD operations.
  • Validation: Leverage form requests for validation to keep controller methods clean.

Conclusion

Controllers in Laravel are potent tools that help organize your application’s logic. By following best practices and utilizing Laravel’s built-in features, such as resource controllers and middleware, you can easily create robust, maintainable applications. Whether handling web requests or building APIs, Laravel controllers are vital in delivering a seamless user experience.

Boost your Laravel apps with our specialized Laravel Hosting. Experience faster speeds for your Laravel applications and websites thanks to NVMe storage, server protection, dedicated resources, and optimization tools.

check mark99.99% Uptime check markFree SSL check markDedicated IP Address check markDeveloper Tools

Laravel Hosting

]]>
https://www.inmotionhosting.com/support/edu/laravel/how-to-use-controllers-in-laravel/feed/ 0 128620
Release Update: InMotion Central v3.1 https://www.inmotionhosting.com/support/product-guides/wordpress-hosting/central/releases-updates/platform-i-release-v3-1/ https://www.inmotionhosting.com/support/product-guides/wordpress-hosting/central/releases-updates/platform-i-release-v3-1/#respond Mon, 19 Aug 2024 17:48:36 +0000 https://www.inmotionhosting.com/support/?p=128550 Read More >]]> Managed WordPress Release Update August 2024

August 13, 2024 – Version 3.1 of Managed WordPress Hosting has arrived! This is a major release with many new features, both in the InMotion Central interface and on the Managed WordPress UltraStack VPS.

New Features

The latest version of Central is out with several new improvements including a new look for our UI! Lets explore all the changes and updates.

Language Expansions

We’re thrilled to announce that our site is now available in multiple languages, making it easier for our global users to enjoy an enhanced experience.

You can now access the Central interface in English, French, German, Spanish, and Hindi.

We’re committed to further expanding language options in the future, ensuring inclusivity and accessibility for all our users. Stay tuned for more updates!

Teams and Interface Updates

We’re excited to unveil our new look! With this release, projects are now displayed by Teams, making it easier for you to navigate directly to the projects that matter most to your current team.

We’ve also streamlined the purchasing process to ensure that new plans or additions are always tied to your currently active team, so you can make purchases with confidence.

Should you need to allocate the purchase to a different team, you can effortlessly do so via a convenient drop-down menu. This enhancement is designed to boost efficiency and ensure that purchases are correctly attributed, making your experience with Central even more intuitive and user-friendly.

Team Subscriptions

You can now seamlessly switch between teams by clicking the “My Teams” dropdown located next to your profile photo.

Additionally, we’ve updated the subscriptions page for improved organization. Subscriptions are now sorted by the nearest renewal time, and you can conveniently resize your server directly from the subscriptions page.

Improvements

Domain TLDs Expansion

Version 3.1 introduces new TLDs to our domain search and checkout, giving you even more options when selecting the perfect domain to match your business brand.

We’ve also added an exciting new feature: the “I Feel Lucky” domain spinner, which randomly generates and searches across TLDs for unique domain ideas.

New TLD additions:

  • .ai
  • .attorney
  • .builders
  • .business
  • .church
  • .company
  • .consulting
  • .deals
  • .digital
  • .events
  • .io
  • .me
  • .news
  • .photo
  • .restaurant
  • .services
  • .software
  • .tech
  • .tv
  • .video

Finally, domains now persist in your cart, making your purchasing process smoother and more convenient.

Additional Enhancements

  • Projects: We’ve introduced more user-friendly project names when creating new projects, and we’ve enhanced project navigation and organization for a smoother experience.
  • Playgrounds: Playgrounds are now project-based instead of team-based. Each user now has access to three playgrounds per project.
  • Improved Site Connection: We’ve enhanced the connection between your WordPress site and Central to ensure better communication between your site and Central.
  • Site URL Changes: In this release, we’ve streamlined the Site URL change process by removing a few integrity checks, making it easier for you to complete this task. This update should reduce friction and help ensure more successful completions.
]]>
https://www.inmotionhosting.com/support/product-guides/wordpress-hosting/central/releases-updates/platform-i-release-v3-1/feed/ 0 128550
Form Validation in Laravel https://www.inmotionhosting.com/support/edu/laravel/form-validation-in-laravel/ https://www.inmotionhosting.com/support/edu/laravel/form-validation-in-laravel/#respond Thu, 15 Aug 2024 16:11:37 +0000 https://www.inmotionhosting.com/support/?p=128552 Read More >]]> Form Validation in Laravel

Form validation is a critical aspect of web application development. It ensures that the data submitted by users meets specific criteria before processing. Laravel provides a powerful and easy-to-use validation system that simplifies this process. This article will guide you through implementing and customising form validation in Laravel.

Introduction to Laravel Form Validation

Laravel’s validation system is designed to make validating user input simple and effective. Whether you’re validating simple form inputs or complex nested arrays, Laravel provides all the necessary tools to handle validation efficiently.

Basic Validation Example

Laravel’s most straightforward way to validate a form request is by using the validate method directly in your controller.

public function store(Request $request)
{
    $validatedData = $request->validate([
        'name' => 'required|max:255',
        'email' => 'required|email|unique:users',
        'password' => 'required|min:8',
    ]);

    // Store the validated data...
}

In this example, the validate method takes an array of validation rules. Laravel automatically redirects the user to the previous page if the validation fails.

Laravel’s Documentation contains all available validation rules and their function.

Using Form Request Validation

For more complex validation logic or when you need to reuse validation rules, it’s best to use Form Request Validation. This involves creating a custom request class.

Step 1: Generate a Form Request class

    php artisan make:request StoreUserRequest

    Step 2: Define validation rules in the generated class

    public function rules()
    {
        return [
            'name' => 'required|max:255',
            'email' => 'required|email|unique:users',
            'password' => 'required|min:8',
        ];
    }

    Step 3: Use the Form Request in your controller

    public function store(StoreUserRequest $request)
    {
        // The incoming request is valid...
        // Store the validated data...
    }

    Form Requests provide a clean way to organize validation logic, especially in large applications.

    Customizing Error Messages

    Laravel allows you to customize the error messages returned when validation fails. You can do this using the validation method or Form Request class.

    Inline in the controller

    $validatedData = $request->validate([
        'name' => 'required|max:255',
    ], [
        'name.required' => 'We need to know your name!',
    ]);

    In a Form Request Class

    public function messages()
    {
        return [
            'name.required' => 'We need to know your name!',
        ];
    }

    Custom messages make your application more user-friendly by providing clearer and more descriptive feedback.

    Validating Arrays

    When your form inputs are arrays, Laravel handles the validation seamlessly. For example:

    public function store(Request $request)
    {
        $validatedData = $request->validate([
            'products.*.name' => 'required',
            'products.*.quantity' => 'required|integer|min:1',
        ]);
    }

    In this example, products.*.name ensures that each product in the array has a name attribute, and products.*.quantity checks that the quantity is an integer greater than zero.

    Conditional Validation

    Sometimes, you must apply validation rules conditionally based on another field’s value. Laravel offers an elegant way to handle this.

    public function store(Request $request)
    {
        $validatedData = $request->validate([
            'email' => 'required|email',
            'phone' => 'required_if:contact_preference,phone',
        ]);
    }

    Here, the phone field is required only if contact_preference is set to phone.

    Custom Validation Rules

    Laravel allows you to define custom validation rules if the built-in ones do not meet your needs.

    Create a custom rule

    php artisan make:rule Uppercase

    Define the validation logic

    public function passes($attribute, $value)
    {
        return strtoupper($value) === $value;
    }
    
    public function message()
    {
        return 'The :attribute must be uppercase.';
    }

    Use the custom rule in your application

    use App\Rules\Uppercase;
    
    public function store(Request $request)
    {
        $validatedData = $request->validate([
            'name' => ['required', new Uppercase],
        ]);
    }

    Custom rules allow you to extend Laravel’s validation capabilities to suit your application’s specific needs.

    Displaying Validation Errors

    After validating the form, Laravel automatically redirects back to the form with the error messages stored in the session. You can easily display these errors to the user in your Blade view.

    @if ($errors->any())
        <div class="alert alert-danger">
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif

    This snippet will display a list of all validation errors, providing clear feedback to the user.

    Conclusion

    Form validation is essential to any Laravel application, ensuring that the data processed is clean, accurate, and secure. Laravel’s validation system is robust and flexible, making it easy to implement validation logic in your application. Whether using basic validation, custom rules, or conditional logic, Laravel provides all the tools necessary to manage user input effectively.

    Following the guidelines and examples in this article, you can confidently handle form validation in your Laravel projects, ensuring a smooth user experience and maintaining the integrity of your application’s data.

    Boost your Laravel apps with our specialized Laravel Hosting. Experience faster speeds for your Laravel applications and websites thanks to NVMe storage, server protection, dedicated resources, and optimization tools.

    check mark99.99% Uptime check markFree SSL check markDedicated IP Address check markDeveloper Tools

    Laravel Hosting

    ]]>
    https://www.inmotionhosting.com/support/edu/laravel/form-validation-in-laravel/feed/ 0 128552
    How to List Accounts in Control Web Panel (CWP) https://www.inmotionhosting.com/support/edu/control-web-panel/cwp-admin/user-and-account-management/how-to-list-accounts-in-control-web-panel-cwp/ https://www.inmotionhosting.com/support/edu/control-web-panel/cwp-admin/user-and-account-management/how-to-list-accounts-in-control-web-panel-cwp/#respond Fri, 02 Aug 2024 17:25:33 +0000 https://www.inmotionhosting.com/support/?p=128468 Read More >]]> How to List Accounts in Control Web Panel

    Managing accounts on your server is crucial to maintaining a secure and efficient hosting environment. Control Web Panel (CWP) provides an intuitive interface for listing and managing user accounts. In this guide, we’ll walk you through the steps for listing accounts in CWP.

    Introduction

    Control Web Panel (CWP) is a web hosting control panel designed to manage dedicated and VPS servers. It offers a wide range of server management features, including the ability to list and manage user accounts easily. Listing accounts in CWP is essential for server administrators to monitor user activity, manage accounts, and ensure server security.

    1. Log into the CWP Admin Panel.
    2. In the left-hand navigation sidebar, click List Accounts under the User Accounts section. Alternatively, you use the Search bar of the navigation sidebar and type “List Accounts”.
      List Accounts Menu
    3. You should now see the List Accounts page showing the accounts created within your server.

    Viewing the List of Accounts

    The List Accounts page will display a list of all user accounts on your server. You can see details such as:

    • Username: The name of the user account.
    • Domain: The primary domain associated with the user.
    • IP Address: The IP address assigned to the user account.
    • Email: The primary email for the user account.
    • Setup Time: The date and time that the account was created.
    • Package: The package assigned to the user account.
    • Reseller: Displays the reseller that owns the user account or if the account has Reseller privileges itself.
    • Disk Usage: The amount of disk space used by the account.
    • Actions: Options to manage the account, including edit, suspend, or delete.

    Managing User Accounts

    Use the buttons under the Actions column of the List Accounts page next to the account you wish to modify. You will see several options:
    List Accounts Actions

    • Suspend Account: Temporarily disable the account.
    • Edit DNS Zone: Edit the Zone file for domains on the user account.
    • Change Password: Change the user account password.
    • Edit Account: Modify the user account settings.
    • Delete Account: Permanently remove the account from the server.

    Conclusion

    Listing and managing user accounts in Control Web Panel is a straightforward process that helps you maintain control over your server’s resources and security. Regularly reviewing your user accounts ensures efficient resource allocation and helps you identify potential security issues. Following these steps, you can effectively manage user accounts on your CWP-managed server.

    Upgrade to VPS Hosting for Peak Performance

    Upgrade to InMotion VPS Hosting today for top-notch performance, security, and flexibility, and save up to $2,412 – a faster, stronger hosting solution is just a click away!

    check markSSD Storage check markHigh-Availability check markIronclad Security check markPremium Support

    VPS Hosting

    ]]>
    https://www.inmotionhosting.com/support/edu/control-web-panel/cwp-admin/user-and-account-management/how-to-list-accounts-in-control-web-panel-cwp/feed/ 0 128468