Repository navigation
Expand file tree
/
Copy pathappliance-error-codes.php
More file actions
169 lines (153 loc) · 9.95 KB
/
Copy pathappliance-error-codes.php
File metadata and controls
169 lines (153 loc) · 9.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
/**
* Plugin Name: Appliance Error Code Helper
* Description: Easily insert appliance diagnostic error code tables into your posts via shortcodes.
* Version: 1.1.0
* Author: Washing Machine Care
* Author URI: https://washingmachinecare.com/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
// ==========================================
// 1. Register Admin Settings & Help Instructions
// ==========================================
add_action('admin_menu', 'aec_register_settings_page');
function aec_register_settings_page() {
add_options_page(
'Appliance Error Codes',
'Error Code Help',
'manage_options',
'aec-settings',
'aec_render_settings_page'
);
}
function aec_render_settings_page() {
?>
<div class="wrap">
<h2>Appliance Error Code Helper - Instructions</h2>
<p>This plugin allows you to quickly insert formatted, responsive diagnostic tables into your content to help users troubleshoot their appliances.</p>
<h3>How to Deploy the Tool</h3>
<p>Insert the following shortcode block into any post or page:</p>
<code>[error_code brand="samsung" code="4C"]</code>
<h3>Supported Brands & Example Codes</h3>
<ul style="list-style-type: square; padding-left: 20px;">
<li><strong>Samsung:</strong> 4C, OE, UE, LE, 5C</li>
<li><strong>LG:</strong> UE, LE, OE, PE, DE</li>
<li><strong>Whirlpool:</strong> F01, F02, F05, LF</li>
<li><strong>GE:</strong> E22, E23, E30, E31</li>
<li><strong>Bosch:</strong> E18, E16, E17, E13</li>
<li><strong>Electrolux:</strong> E11, E21, E5E</li>
<li><strong>Maytag:</strong> Sd, uL, F08</li>
<li><strong>Kenmore:</strong> F2, F9, Sd</li>
<li><strong>Frigidaire:</strong> E11, E13, E21</li>
<li><strong>Amana:</strong> F8, F9, Sd</li>
</ul>
<hr style="margin: 20px 0;">
<h3>Advanced Repair Resources</h3>
<p>Explore complete brand-specific repair manuals and maintenance schedules at <a href="https://washingmachinecare.com/" target="_blank">Washing Machine Care</a> to optimize appliance longevity.</p>
</div>
<?php
}
// ==========================================
// 2. Register and Process the Shortcode
// ==========================================
add_shortcode('error_code', 'aec_render_error_code_table');
function aec_render_error_code_table($atts) {
// Extract shortcode attributes
$atts = shortcode_atts(
array(
'brand' => 'generic',
'code' => 'unknown',
),
$atts,
'error_code'
);
$brand = strtolower(sanitize_text_field($atts['brand']));
$code = strtoupper(sanitize_text_field($atts['code']));
// Expanded Error Database
$error_database = array(
'samsung' => array(
'4C' => array('issue' => 'Water Supply Error', 'fix' => 'Check water supply valves, ensure hoses are not kinked, and clean the mesh filter.'),
'OE' => array('issue' => 'Overflow Error', 'fix' => 'Inspect the water level sensor and drain pump for blockages.'),
'UE' => array('issue' => 'Unbalanced Load', 'fix' => 'Redistribute the laundry evenly and ensure the machine is level.'),
'LE' => array('issue' => 'Water Leakage', 'fix' => 'Check all hoses, the drain pump, and the door seal for leaks.'),
'5C' => array('issue' => 'Water Drain Error', 'fix' => 'Clean the debris filter and ensure the drain hose is not clogged.')
),
'lg' => array(
'UE' => array('issue' => 'Unbalanced Load', 'fix' => 'Redistribute the laundry evenly and ensure the machine is level on the floor.'),
'LE' => array('issue' => 'Motor Locked Error', 'fix' => 'Reset the machine. If the issue persists, inspect the rotor or hall sensor.'),
'OE' => array('issue' => 'Drain Error', 'fix' => 'Check the drain hose for kinks and clean the drain pump filter.'),
'PE' => array('issue' => 'Water Level Sensor Error', 'fix' => 'Check the wiring to the pressure sensor and replace if defective.'),
'DE' => array('issue' => 'Door Open Error', 'fix' => 'Close the door firmly. Check the door latch and lock switch for damage.')
),
'whirlpool' => array(
'F01' => array('issue' => 'Main Electronic Control Board Error', 'fix' => 'Unplug the washer for 1 minute. If error returns, replace the main control board.'),
'F02' => array('issue' => 'Long Drain Time', 'fix' => 'Check the drain hose for kinks. Clean the pump filter and check the drain pump.'),
'F05' => array('issue' => 'Water Temperature Sensor Error', 'fix' => 'Check the NTC thermistor and wiring for continuity.'),
'LF' => array('issue' => 'Long Fill Time', 'fix' => 'Ensure water valves are fully open. Check inlet screens for clogs.')
),
'ge' => array(
'E22' => array('issue' => 'Fill Timeout', 'fix' => 'Check water supply valves and inlet hoses. Clean the valve screens.'),
'E23' => array('issue' => 'Flood Protect Drain', 'fix' => 'Check for a leaking water valve or a faulty pressure sensor.'),
'E30' => array('issue' => 'Drain Pump Error', 'fix' => 'Clear the pump filter and check the drain pump motor for continuity.'),
'E31' => array('issue' => 'Slow Drain', 'fix' => 'Inspect the drain hose and pump for obstructions.')
),
'bosch' => array(
'E18' => array('issue' => 'Pump Timeout', 'fix' => 'Clean the drain pump filter and check the drain hose for blockages.'),
'E16' => array('issue' => 'Door Open Error', 'fix' => 'Ensure the door is securely closed. Check the door interlock mechanism.'),
'E17' => array('issue' => 'Water Supply Error', 'fix' => 'Open the water tap fully and check the inlet hose filter.'),
'E13' => array('issue' => 'Drain Time Exceeded', 'fix' => 'Check the drain system for blockages and ensure the pump operates.')
),
'electrolux' => array(
'E11' => array('issue' => 'Fill Time Too Long', 'fix' => 'Check water inlet valves, hoses, and ensure house water pressure is adequate.'),
'E21' => array('issue' => 'Water Not Pumping Out', 'fix' => 'Check the drain pump and filter for clogs or a seized motor.'),
'E5E' => array('issue' => 'Communication Error', 'fix' => 'Inspect wiring between the main control board and motor control board.')
),
'maytag' => array(
'SD' => array('issue' => 'Sudsing Detected', 'fix' => 'Run a clean cycle with no detergent. Switch to High Efficiency (HE) detergent.'),
'UL' => array('issue' => 'Unbalanced Load', 'fix' => 'Pause the cycle, manually redistribute the wet clothing, and resume.'),
'F08' => array('issue' => 'Heating Failure', 'fix' => 'Inspect the heating element and thermal fuse for continuity.')
),
'kenmore' => array(
'F2' => array('issue' => 'Drain Failure', 'fix' => 'Clear the drain pump filter and inspect the drain hose for blockage.'),
'F9' => array('issue' => 'Water System Imbalance', 'fix' => 'Ensure the machine is not siphoning water. Check drain hose height.'),
'SD' => array('issue' => 'Excessive Suds', 'fix' => 'Run a rinse cycle. Reduce detergent usage in future loads.')
),
'frigidaire' => array(
'E11' => array('issue' => 'Fill Time Error', 'fix' => 'Check water supply lines and clean the inlet valve screens.'),
'E13' => array('issue' => 'Water Leak Detected', 'fix' => 'Inspect the tub, hoses, and door boot seal for visible leaks.'),
'E21' => array('issue' => 'Drain Error', 'fix' => 'Clean the coin trap/filter and verify the drain pump is receiving power.')
),
'amana' => array(
'F8' => array('issue' => 'Overfill Detected', 'fix' => 'Check the pressure switch and the water inlet valve for proper function.'),
'F9' => array('issue' => 'Drain Issue', 'fix' => 'Ensure the drain hose is clear and the pump is unobstructed.'),
'SD' => array('issue' => 'Suds Lock', 'fix' => 'Run a clear water cycle to flush excess detergent from the drum.')
)
);
// Check if the specific brand and code exist in the array
if (isset($error_database[$brand][$code])) {
$issue = $error_database[$brand][$code]['issue'];
$fix = $error_database[$brand][$code]['fix'];
// Construct the HTML Table Output
$output = '<table style="width:100%; border-collapse: collapse; margin-bottom: 15px;" border="1">';
$output .= '<thead><tr>';
$output .= '<th style="padding: 8px; text-align: left; background-color: #f8f9fa;">Brand</th>';
$output .= '<th style="padding: 8px; text-align: left; background-color: #f8f9fa;">Error Code</th>';
$output .= '<th style="padding: 8px; text-align: left; background-color: #f8f9fa;">Issue</th>';
$output .= '<th style="padding: 8px; text-align: left; background-color: #f8f9fa;">Resolution Steps</th>';
$output .= '</tr></thead>';
$output .= '<tbody><tr>';
$output .= '<td style="padding: 8px;">' . ucfirst($brand) . '</td>';
$output .= '<td style="padding: 8px;"><strong>' . $code . '</strong></td>';
$output .= '<td style="padding: 8px;">' . $issue . '</td>';
$output .= '<td style="padding: 8px;">' . $fix . '</td>';
$output .= '</tr></tbody></table>';
// Contextual backlink embedded for front-end deployment
$output .= '<p style="font-size:12px; color:#666;">Diagnostic data provided by <a href="https://washingmachinecare.com/" target="_blank" style="color:#666; text-decoration:underline;">Washing Machine Care</a>.</p>';
return $output;
} else {
return '<p><em>Error code ' . esc_html($code) . ' for brand ' . esc_html(ucfirst($brand)) . ' not found in the database.</em></p>';
}
}
?>