Developer Guide

Customization Guide (Best Practices for Developers)

Estimated reading: 3 minutes 47 views

This guide covers recommended methods for safely and efficiently customizing Movie Engine.
Follow these best practices to ensure your changes are scalable, maintainable, and update-safe.

๐Ÿš€ Core Principles

When customizing Movie Engine, always follow this priority order:

  1. Use Hooks (Actions & Filters) โ†’ First choice
  2. Override Templates โ†’ When structure changes are needed
  3. Custom Plugin / Functions.php โ†’ For logic extensions
  4. Avoid Editing Core Plugin Files โŒ

๐Ÿ”Œ Use Hooks (Recommended)

Hooks are the safest and most flexible way to customize Movie Engine.

Why use hooks?

  • No risk during plugin updates
  • Easy to manage and remove
  • Works across themes

Example

add_action('movie_engine_before_player', function() {
echo '<div class="notice">Content may not be suitable for all audiences.</div>';
});

๐Ÿ‘‰ Use hooks for:

  • Adding banners, ads, notices
  • Injecting custom sections
  • Modifying output with filters

๐Ÿงฉ Template Overrides

Use template overrides when you need to change the layout or HTML structure.

๐Ÿ“ Override Path

your-theme/movie-engine/

Example

your-theme/movie-engine/archive-movie.php
your-theme/movie-engine/single-movie.php

Best Practices

  • Copy only the files you need
  • Keep overrides minimal
  • Re-check after plugin updates

โš™๏ธ Use a Custom Plugin (Recommended for Advanced Users)

Instead of adding everything to functions.php, create a custom plugin.

Why?

  • Keeps logic separate from theme
  • Safer when switching themes
  • Better for scaling

Example Structure

wp-content/plugins/my-movie-engine-custom/my-movie-engine-custom.php

๐ŸŽฏ Combine Hooks + Templates (Power Approach)

For advanced customization:

  • Use templates โ†’ for layout
  • Use hooks โ†’ for dynamic content

๐Ÿ‘‰ Example:

  • Override single-movie.php
  • Add extra sections via movie_engine_single_movie_content

๐Ÿ’ฐ Monetization Customization

Movie Engine provides multiple hooks for ads and revenue.

Best Practices

  • Use:
    • movie_engine_ad_player_top
    • movie_engine_ad_player_bottom
  • Avoid hardcoding ads in templates

๐Ÿ‘‰ This keeps ads flexible and manageable.

๐Ÿ” Membership & Access Control

Use filters to control premium content:

  • movie_engine_is_premium
  • movie_engine_is_restricted
  • movie_engine_preview_duration

Example

add_filter('movie_engine_preview_duration', function($seconds) {
return 120; // 2-minute preview
});

๐ŸŽจ Styling & UI Customization

Recommended Approach

  • Add styles in your theme:
style.css

or enqueue custom CSS:

wp_enqueue_style('custom-style', get_stylesheet_directory_uri() . '/custom.css');

Avoid

  • Editing plugin CSS directly โŒ

โšก Performance Best Practices

  • Avoid heavy queries inside hooks
  • Cache expensive operations
  • Minimize DOM-heavy injections
  • Use lazy loading for media

๐Ÿ”„ Update-Safe Strategy

To keep your customizations safe:

  • โœ… Use hooks whenever possible
  • โœ… Use template overrides properly
  • โœ… Keep custom code separate
  • โŒ Never edit plugin core files

๐Ÿงช Debugging Tips

  • Enable WordPress debug:

define('WP_DEBUG', true);

  • Check:
    • Hook priority issues
    • Missing template overrides
    • Conflicts with theme/plugins

๐Ÿ“ฆ Developer Workflow (Recommended)

  1. Create a child theme or a custom plugin
  2. Add hooks for small changes
  3. Override templates for layout
  4. Test on staging site
  5. Optimize performance

๐Ÿ“Œ Summary

TaskRecommended Method
Add contentHooks
Modify dataFilters
Change layoutTemplate override
Add logicCustom plugin
StylingTheme CSS

Share this Doc

Customization Guide (Best Practices for Developers)

Or copy link

CONTENTS